formats.py 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. # -*- encoding: utf-8 -*-
  2. # This file is distributed under the same license as the Django package.
  3. #
  4. from __future__ import unicode_literals
  5. # The *_FORMAT strings use the Django date format syntax,
  6. # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
  7. DATE_FORMAT = 'j F Y' # '20 januari 2009'
  8. TIME_FORMAT = 'H:i' # '15:23'
  9. DATETIME_FORMAT = 'j F Y H:i' # '20 januari 2009 15:23'
  10. YEAR_MONTH_FORMAT = 'F Y' # 'januari 2009'
  11. MONTH_DAY_FORMAT = 'j F' # '20 januari'
  12. SHORT_DATE_FORMAT = 'j-n-Y' # '20-1-2009'
  13. SHORT_DATETIME_FORMAT = 'j-n-Y H:i' # '20-1-2009 15:23'
  14. FIRST_DAY_OF_WEEK = 1 # Monday (in Dutch 'maandag')
  15. # The *_INPUT_FORMATS strings use the Python strftime format syntax,
  16. # see http://docs.python.org/library/datetime.html#strftime-strptime-behavior
  17. DATE_INPUT_FORMATS = (
  18. '%d-%m-%Y', '%d-%m-%y', # '20-01-2009', '20-01-09'
  19. '%d/%m/%Y', '%d/%m/%y', # '20/01/2009', '20/01/09'
  20. # '%d %b %Y', '%d %b %y', # '20 jan 2009', '20 jan 09'
  21. # '%d %B %Y', '%d %B %y', # '20 januari 2009', '20 januari 09'
  22. )
  23. # Kept ISO formats as one is in first position
  24. TIME_INPUT_FORMATS = (
  25. '%H:%M:%S', # '15:23:35'
  26. '%H:%M:%S.%f', # '15:23:35.000200'
  27. '%H.%M:%S', # '15.23:35'
  28. '%H.%M:%S.%f', # '15.23:35.000200'
  29. '%H.%M', # '15.23'
  30. '%H:%M', # '15:23'
  31. )
  32. DATETIME_INPUT_FORMATS = (
  33. # With time in %H:%M:%S :
  34. '%d-%m-%Y %H:%M:%S', '%d-%m-%y %H:%M:%S', '%Y-%m-%d %H:%M:%S', # '20-01-2009 15:23:35', '20-01-09 15:23:35', '2009-01-20 15:23:35'
  35. '%d/%m/%Y %H:%M:%S', '%d/%m/%y %H:%M:%S', '%Y/%m/%d %H:%M:%S', # '20/01/2009 15:23:35', '20/01/09 15:23:35', '2009/01/20 15:23:35'
  36. # '%d %b %Y %H:%M:%S', '%d %b %y %H:%M:%S', # '20 jan 2009 15:23:35', '20 jan 09 15:23:35'
  37. # '%d %B %Y %H:%M:%S', '%d %B %y %H:%M:%S', # '20 januari 2009 15:23:35', '20 januari 2009 15:23:35'
  38. # With time in %H:%M:%S.%f :
  39. '%d-%m-%Y %H:%M:%S.%f', '%d-%m-%y %H:%M:%S.%f', '%Y-%m-%d %H:%M:%S.%f', # '20-01-2009 15:23:35.000200', '20-01-09 15:23:35.000200', '2009-01-20 15:23:35.000200'
  40. '%d/%m/%Y %H:%M:%S.%f', '%d/%m/%y %H:%M:%S.%f', '%Y/%m/%d %H:%M:%S.%f', # '20/01/2009 15:23:35.000200', '20/01/09 15:23:35.000200', '2009/01/20 15:23:35.000200'
  41. # With time in %H.%M:%S :
  42. '%d-%m-%Y %H.%M:%S', '%d-%m-%y %H.%M:%S', # '20-01-2009 15.23:35', '20-01-09 15.23:35'
  43. '%d/%m/%Y %H.%M:%S', '%d/%m/%y %H.%M:%S', # '20/01/2009 15.23:35', '20/01/09 15.23:35'
  44. # '%d %b %Y %H.%M:%S', '%d %b %y %H.%M:%S', # '20 jan 2009 15.23:35', '20 jan 09 15.23:35'
  45. # '%d %B %Y %H.%M:%S', '%d %B %y %H.%M:%S', # '20 januari 2009 15.23:35', '20 januari 2009 15.23:35'
  46. # With time in %H.%M:%S.%f :
  47. '%d-%m-%Y %H.%M:%S.%f', '%d-%m-%y %H.%M:%S.%f', # '20-01-2009 15.23:35.000200', '20-01-09 15.23:35.000200'
  48. '%d/%m/%Y %H.%M:%S.%f', '%d/%m/%y %H.%M:%S.%f', # '20/01/2009 15.23:35.000200', '20/01/09 15.23:35.000200'
  49. # With time in %H:%M :
  50. '%d-%m-%Y %H:%M', '%d-%m-%y %H:%M', '%Y-%m-%d %H:%M', # '20-01-2009 15:23', '20-01-09 15:23', '2009-01-20 15:23'
  51. '%d/%m/%Y %H:%M', '%d/%m/%y %H:%M', '%Y/%m/%d %H:%M', # '20/01/2009 15:23', '20/01/09 15:23', '2009/01/20 15:23'
  52. # '%d %b %Y %H:%M', '%d %b %y %H:%M', # '20 jan 2009 15:23', '20 jan 09 15:23'
  53. # '%d %B %Y %H:%M', '%d %B %y %H:%M', # '20 januari 2009 15:23', '20 januari 2009 15:23'
  54. # With time in %H.%M :
  55. '%d-%m-%Y %H.%M', '%d-%m-%y %H.%M', # '20-01-2009 15.23', '20-01-09 15.23'
  56. '%d/%m/%Y %H.%M', '%d/%m/%y %H.%M', # '20/01/2009 15.23', '20/01/09 15.23'
  57. # '%d %b %Y %H.%M', '%d %b %y %H.%M', # '20 jan 2009 15.23', '20 jan 09 15.23'
  58. # '%d %B %Y %H.%M', '%d %B %y %H.%M', # '20 januari 2009 15.23', '20 januari 2009 15.23'
  59. # Without time :
  60. '%d-%m-%Y', '%d-%m-%y', '%Y-%m-%d', # '20-01-2009', '20-01-09', '2009-01-20'
  61. '%d/%m/%Y', '%d/%m/%y', '%Y/%m/%d', # '20/01/2009', '20/01/09', '2009/01/20'
  62. # '%d %b %Y', '%d %b %y', # '20 jan 2009', '20 jan 09'
  63. # '%d %B %Y', '%d %B %y', # '20 januari 2009', '20 januari 2009'
  64. )
  65. DECIMAL_SEPARATOR = ','
  66. THOUSAND_SEPARATOR = '.'
  67. NUMBER_GROUPING = 3