Commit 26cffe6b authored by Claudio Cambra's avatar Claudio Cambra
Browse files

Fix titledatebutton text

parent 1919c59f
Pipeline #115934 failed with stage
in 4 minutes and 2 seconds
......@@ -23,14 +23,16 @@ QQC2.ToolButton {
horizontalAlignment: Text.AlignHCenter
text: {
let locale = Qt.locale();
let monthYearString = i18nc("%1 is month name, %2 is year", "<b>%1</b> %2", locale.standaloneMonthName(root.date.getMonth()), String(root.date.getFullYear()));
let endRangeMonthYearString = i18nc("%1 is month name, %2 is year", "<b>%1</b> %2", locale.standaloneMonthName(root.lastDate.getMonth()), String(root.lastDate.getFullYear()));
const locale = Qt.locale();
const monthYearString = i18nc("%1 is month name, %2 is year", "<b>%1</b> %2", locale.standaloneMonthName(root.date.getMonth()), String(root.date.getFullYear()));
if(!root.range) {
return monthYearString;
} else {
const endRangeMonthYearString = i18nc("%1 is month name, %2 is year", "<b>%1</b> %2", locale.standaloneMonthName(root.lastDate.getMonth()), String(root.lastDate.getFullYear()));
if(root.date.getFullYear() !== root.lastDate.getFullYear()) {
return i18nc("%1 is the month and year of the range start, %2 is the same for range end", "%1 - %2", monthYearString, endrangeMonthYearString);
return i18nc("%1 is the month and year of the range start, %2 is the same for range end", "%1 - %2", monthYearString, endRangeMonthYearString);
} else if(root.date.getMonth() !== root.lastDate.getMonth()) {
return i18nc("%1 is month of range start, %2 is month + year of range end", "<b>%1</b> - %2", locale.standaloneMonthName(root.date.getMonth()), endRangeMonthYearString);
} else {
......
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