From 4fc65dd457610e7e52f927b3d0b8293f5026d60f Mon Sep 17 00:00:00 2001
From: Seblu <sebastien.luttringer@smartjog.com>
Date: Wed, 2 Mar 2011 20:26:38 +0100
Subject: [PATCH] new tagdisplay type date,time,datetime

---
 cccli/tagdisplay.py | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/cccli/tagdisplay.py b/cccli/tagdisplay.py
index 621385c..2328252 100644
--- a/cccli/tagdisplay.py
+++ b/cccli/tagdisplay.py
@@ -13,6 +13,7 @@ import math
 import ConfigParser
 import time
 import fnmatch
+import datetime
 
 class TagDisplay(object):
     '''Handle tagdisplay stuff'''
@@ -146,3 +147,17 @@ class TagDisplay(object):
                 return u"%dd%dh%dm%ds"%(v/86400, v/3600%24, v/60%60, v%60)
         return value
 
+    def type_date(self, value):
+        '''date type'''
+        d = datetime.date.fromtimestamp(float(value))
+        return d.strftime("%d/%m/%Y")
+
+    def type_time(self, value):
+        '''date type'''
+        d = datetime.date.fromtimestamp(float(value))
+        return d.strftime("%H:%M:%S")
+
+    def type_datetime(self, value):
+        '''date type'''
+        d = datetime.date.fromtimestamp(float(value))
+        return d.strftime("%d/%m/%Y %H:%M:%S")
-- 
GitLab