コード例 #1
0
 def _time_range_string(self, start, end):
     start = PharaonicDateTime.from_time(start)
     end = PharaonicDateTime.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
 def label_without_time(time):
     pharaonic_datetime = PharaonicDateTime.from_time(time)
     return "%s %s %s" % (
         pharaonic_datetime.day,
         abbreviated_name_of_month(pharaonic_datetime.month),
         format_year(pharaonic_datetime.year)
     )
コード例 #3
0
 def label(self, time, major=False):
     time = PharaonicDateTime.from_time(time)
     if major:
         return "%s %s %s" % (time.day,
                              abbreviated_name_of_month(time.month),
                              format_year(time.year))
     return str(time.day)
コード例 #4
0
 def label(self, time, major=False):
     day_of_week = PharaonicTimeType().get_day_of_week(time)
     if major:
         time = PharaonicDateTime.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" % PharaonicDateTime.from_time(time).day)
コード例 #5
0
 def _format_month(self, month):
     if self._use_abbreviated_name_for_month:
         return abbreviated_name_of_month(month)
     else:
         return "%02d" % month