Commit 5b4e6a70 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Add new variable as discussed with David

parent 800f6d35
......@@ -66,6 +66,31 @@ QString MessageComposer::ConvertSnippetVariablesUtil::snippetVariableFromEnum(Me
return QLatin1String("%ATTACHMENTFILENAMES");
case AttachmentNamesAndSizes:
return QLatin1String("%ATTACHMENTNAMESANDSIZES");
case Year:
return QLatin1String("%YEAR");
case LastYear:
return QLatin1String("%LASTYEAR");
case NextYear:
return QLatin1String("%NEXTYEAR");
case MonthNumber:
return QLatin1String("%MONTHNUMBER"); //1-12
case DayOfMonth:
return QLatin1String("%DAYOFMONTH"); //1-31
case WeekNumber:
return QLatin1String("%WEEKNUMBER"); //1-52
case MonthNameShort:
return QLatin1String("%MONTHNAMESHORT"); //(Jan-Dec)
case MonthNameLong:
return QLatin1String("%MONTHNAMELONG"); //(January-December)
case DayOfWeek:
return QLatin1String("%DAYOFWEEK"); //(1-7)
case DayOfWeekNameShort:
return QLatin1String("%DAYOFWEEKNAMESHORT"); //(Mon-Sun)
case DayOfWeekNameLong:
return QLatin1String("%DAYOFWEEKNAMELONG"); //(Monday-Sunday)
case YearLastMonth:
return QLatin1String("%YEARLASTMONTH"); //january 2020 will how 2019-12
}
return {};
}
......@@ -47,6 +47,18 @@ enum VariableType {
AttachmentCount,
AttachmentFilenames,
AttachmentNamesAndSizes,
Year,
LastYear,
NextYear,
MonthNumber,
DayOfMonth,
WeekNumber,
MonthNameShort,
MonthNameLong,
DayOfWeek,
DayOfWeekNameShort,
DayOfWeekNameLong,
YearLastMonth
};
Q_REQUIRED_RESULT MESSAGECOMPOSER_EXPORT QString snippetVariableFromEnum(MessageComposer::ConvertSnippetVariablesUtil::VariableType type);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment