Example #1
0
 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))
Example #2
0
 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)
Example #3
0
 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)
Example #4
0
 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))
Example #5
0
 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)
Example #6
0
 def _format_month(self, month):
     if self._use_abbreviated_name_for_month:
         return abbreviated_name_of_month(month)
     else:
         return "%02d" % month