You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

dates.py 2.0KB

5 years ago
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. "Commonly-used date structures"
  2. from django.utils.translation import gettext_lazy as _, pgettext_lazy
  3. WEEKDAYS = {
  4. 0: _('Monday'), 1: _('Tuesday'), 2: _('Wednesday'), 3: _('Thursday'), 4: _('Friday'),
  5. 5: _('Saturday'), 6: _('Sunday')
  6. }
  7. WEEKDAYS_ABBR = {
  8. 0: _('Mon'), 1: _('Tue'), 2: _('Wed'), 3: _('Thu'), 4: _('Fri'),
  9. 5: _('Sat'), 6: _('Sun')
  10. }
  11. MONTHS = {
  12. 1: _('January'), 2: _('February'), 3: _('March'), 4: _('April'), 5: _('May'), 6: _('June'),
  13. 7: _('July'), 8: _('August'), 9: _('September'), 10: _('October'), 11: _('November'),
  14. 12: _('December')
  15. }
  16. MONTHS_3 = {
  17. 1: _('jan'), 2: _('feb'), 3: _('mar'), 4: _('apr'), 5: _('may'), 6: _('jun'),
  18. 7: _('jul'), 8: _('aug'), 9: _('sep'), 10: _('oct'), 11: _('nov'), 12: _('dec')
  19. }
  20. MONTHS_AP = { # month names in Associated Press style
  21. 1: pgettext_lazy('abbrev. month', 'Jan.'),
  22. 2: pgettext_lazy('abbrev. month', 'Feb.'),
  23. 3: pgettext_lazy('abbrev. month', 'March'),
  24. 4: pgettext_lazy('abbrev. month', 'April'),
  25. 5: pgettext_lazy('abbrev. month', 'May'),
  26. 6: pgettext_lazy('abbrev. month', 'June'),
  27. 7: pgettext_lazy('abbrev. month', 'July'),
  28. 8: pgettext_lazy('abbrev. month', 'Aug.'),
  29. 9: pgettext_lazy('abbrev. month', 'Sept.'),
  30. 10: pgettext_lazy('abbrev. month', 'Oct.'),
  31. 11: pgettext_lazy('abbrev. month', 'Nov.'),
  32. 12: pgettext_lazy('abbrev. month', 'Dec.')
  33. }
  34. MONTHS_ALT = { # required for long date representation by some locales
  35. 1: pgettext_lazy('alt. month', 'January'),
  36. 2: pgettext_lazy('alt. month', 'February'),
  37. 3: pgettext_lazy('alt. month', 'March'),
  38. 4: pgettext_lazy('alt. month', 'April'),
  39. 5: pgettext_lazy('alt. month', 'May'),
  40. 6: pgettext_lazy('alt. month', 'June'),
  41. 7: pgettext_lazy('alt. month', 'July'),
  42. 8: pgettext_lazy('alt. month', 'August'),
  43. 9: pgettext_lazy('alt. month', 'September'),
  44. 10: pgettext_lazy('alt. month', 'October'),
  45. 11: pgettext_lazy('alt. month', 'November'),
  46. 12: pgettext_lazy('alt. month', 'December')
  47. }