diff options
author | deva <deva> | 2009-02-12 14:42:04 +0000 |
---|---|---|
committer | deva <deva> | 2009-02-12 14:42:04 +0000 |
commit | 22e0b0ddd78f13b2648befe892d9ec6c5b1b1229 (patch) | |
tree | 4c7b8239f5ccac7f9d48b77aaf56524c9a85a971 /client | |
parent | 8064990a976bdc65bc798ba6aab978533485eb2d (diff) |
Added fuzziness attribute.
Diffstat (limited to 'client')
-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") { |