コード例 #1
0
def make_long_date_format(arrowtime: Arrow) -> str:
    # Translators: for example Nov 3 or Dec 31
    # Translators: %(variable)s represents Python code, not a plural of the term
    # variable. You must keep the %(variable)s untranslated, or the program will
    # crash.
    long_format = _('%(month)s %(numeric_day)s') % {
        'month': arrowtime.datetime.strftime('%b'),
        'numeric_day': arrowtime.format('D')
    }
    # Translators: for example Nov 15 2015
    # Translators: %(variable)s represents Python code, not a plural of the term
    # variable. You must keep the %(variable)s untranslated, or the program will
    # crash.
    return _('%(date)s %(year)s') % dict(date=long_format, year=arrowtime.year)
コード例 #2
0
ファイル: calender.py プロジェクト: zzhshouhou/yobot
 def at(self, day: Arrow):
     daystr = day.format(fmt="YYYYMMDD", locale="zh_cn")
     return self._tineline.get(daystr, ())