예제 #1
0
 def format_date(self, dt):
     return format_date(dt)
예제 #2
0
 def exists_to(self):
     exists_to = self.model.attrs['exists_to']
     return format_date(exists_to, long=False)
예제 #3
0
 def format_date(self, dt):
     return format_date(dt)
예제 #4
0
 def exists_from(self):
     exists_from = self.model.attrs['exists_from']
     return format_date(exists_from, long=False)
예제 #5
0
 def test_format_date(self):
     dt = datetime(2011, 3, 15)
     self.assertEqual(format_date(dt), '15.03.2011 00:00')
     self.assertEqual(format_date(dt, long=False), '15.03.2011')
     self.assertEqual(format_date(object()), u'unknown')
예제 #6
0
 def duration_to(self):
     duration_to = self.model.attrs['duration_to']
     return format_date(duration_to, long=False)
예제 #7
0
 def duration_from(self):
     duration_from = self.model.attrs['duration_from']
     return format_date(duration_from, long=False)
예제 #8
0
 def test_format_date(self):
     dt = datetime(2011, 3, 15)
     self.assertEqual(format_date(dt), '15.03.2011 00:00')
     self.assertEqual(format_date(dt, long=False), '15.03.2011')
     self.assertEqual(format_date(object()), u'unknown')