diff options
-rw-r--r-- | client/widgets/datetime.cc | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/client/widgets/datetime.cc b/client/widgets/datetime.cc index 40aa31a..8f85186 100644 --- a/client/widgets/datetime.cc +++ b/client/widgets/datetime.cc @@ -38,6 +38,38 @@ DateTime::DateTime(QDomNode &node, MacroWindow *macrowindow) setMinimumDateTime(QDateTime::fromTime_t(0)); QDomElement elem = node.toElement(); + + switch(elem.attribute("fuzziness", "5").toLong()) { + case 1: + setDisplayFormat("yyyy"); + break; + + case 2: + setDisplayFormat("MMM yyyy"); + break; + + case 3: + setDisplayFormat("dd MMM yyyy"); + break; + + case 4: + setDisplayFormat("dd MMM yyyy hh"); + break; + + case 5: + setDisplayFormat("dd MMM yyyy hh:mm"); + break; + + case 6: + setDisplayFormat("dd MMM yyyy hh:mm:ss"); + break; + + case 7: + default: + setDisplayFormat("dd MMM yyyy hh:mm:ss:zzz"); + break; + } + /* if(elem.hasAttribute("readonly")) { if(elem.attribute("readonly") == "true" || elem.attribute("readonly") == "1") { |