projects
/
weightgraph
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fixed a locale bug in stats view, improved edit window.
[weightgraph]
/
weightgraph
/
weightstatsview.cpp
diff --git
a/weightgraph/weightstatsview.cpp
b/weightgraph/weightstatsview.cpp
index
65e4f0f
..
0ab0362
100644
(file)
--- a/
weightgraph/weightstatsview.cpp
+++ b/
weightgraph/weightstatsview.cpp
@@
-28,6
+28,8
@@
WeightStatsView::WeightStatsView(WeightDataModel *wdm, QWidget *parent) :
updateStats();
}
updateStats();
}
+static const char* wdays[] = {"Monday", "Tuesday", "Wednesday", "Thursday",
+ "Friday", "Saturday", "Sunday"};
QString dateString(QDate date)
{
int days = date.daysTo(QDate::currentDate());
QString dateString(QDate date)
{
int days = date.daysTo(QDate::currentDate());
@@
-38,7
+40,9
@@
QString dateString(QDate date)
else if (days == 1)
return "Yesterday";
else if (days < 7)
else if (days == 1)
return "Yesterday";
else if (days < 7)
- return date.toString("dddd");
+ // return date.toString("dddd"); (Use this with l10n!)
+ // The following is used because the system locale might not be English
+ return wdays[date.dayOfWeek()-1];
else
return date.toString(Qt::ISODate);
}
else
return date.toString(Qt::ISODate);
}