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))
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) )
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)
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)
def _format_month(self, month): if self._use_abbreviated_name_for_month: return abbreviated_name_of_month(month) else: return "%02d" % month