예제 #1
0
파일: timetype.py 프로젝트: weeksjm/gnumed
 def _time_range_string(self, start, end):
     start = CopticDateTime.from_time(start)
     end = CopticDateTime.from_time(end)
     if start.year == end.year:
         if start.month == end.month:
             return "%s-%s %s %s" % (start.day, end.day,
                                     abbreviated_name_of_month(start.month),
                                     format_year(start.year))
         return "%s %s-%s %s %s" % (
             start.day, abbreviated_name_of_month(start.month), end.day,
             abbreviated_name_of_month(end.month), format_year(start.year))
     return "%s %s %s-%s %s %s" % (
         start.day, abbreviated_name_of_month(
             start.month), format_year(start.year), end.day,
         abbreviated_name_of_month(end.month), format_year(end.year))
예제 #2
0
파일: timetype.py 프로젝트: weeksjm/gnumed
 def label(self, time, major=False):
     time = CopticDateTime.from_time(time)
     if major:
         return "%s %s %s: %s:%s" % (
             time.day, abbreviated_name_of_month(time.month),
             format_year(time.year), time.hour, time.minute)
     return str(time.minute)
예제 #3
0
파일: timetype.py 프로젝트: weeksjm/gnumed
 def label(self, time, major=False):
     day_of_week = CopticTimeType().get_day_of_week(time)
     if major:
         time = CopticDateTime.from_time(time)
         return "%s %s %s %s" % (
             abbreviated_name_of_weekday(day_of_week), time.day,
             abbreviated_name_of_month(time.month), format_year(time.year))
     return (abbreviated_name_of_weekday(day_of_week) +
             " %s" % CopticDateTime.from_time(time).day)
예제 #4
0
파일: timetype.py 프로젝트: weeksjm/gnumed
 def label_without_time(time):
     coptic_datetime = CopticDateTime.from_time(time)
     return "%s %s %s" % (coptic_datetime.day,
                          abbreviated_name_of_month(
                              coptic_datetime.month),
                          format_year(coptic_datetime.year))
예제 #5
0
파일: timetype.py 프로젝트: weeksjm/gnumed
 def label(self, time, major=False):
     time = CopticDateTime.from_time(time)
     if major:
         return "%s %s" % (abbreviated_name_of_month(
             time.month), format_year(time.year))
     return abbreviated_name_of_month(time.month)
예제 #6
0
 def _format_month(self, month):
     if self._use_abbreviated_name_for_month:
         return abbreviated_name_of_month(month)
     else:
         return "%02d" % month