2020-07-22 03:46:46 +00:00
|
|
|
from django.conf import settings
|
|
|
|
from django.conf.locale.en import formats
|
|
|
|
|
|
|
|
# Override the regular locale settings to support 24 hour time.
|
|
|
|
if settings.USE_24_HOUR_TIME_FORMAT:
|
|
|
|
DATETIME_FORMAT = 'N j, Y, H:i:s'
|
2020-07-23 04:13:31 +00:00
|
|
|
CUSTOM_INPUT_FORMATS = [
|
2020-07-23 03:27:44 +00:00
|
|
|
'%m/%d/%Y %H:%M:%S', # '10/25/2006 14:30:59'
|
|
|
|
'%m/%d/%Y %H:%M', # '10/25/2006 14:30'
|
2020-07-22 03:46:46 +00:00
|
|
|
]
|
2020-07-23 02:56:11 +00:00
|
|
|
SHORT_DATETIME_FORMAT = 'm/d/Y G:i:s'
|
|
|
|
TIME_FORMAT = 'H:i:s'
|
2020-07-22 03:46:46 +00:00
|
|
|
else:
|
|
|
|
# These formats are added to support the locale style of Baby Buddy's
|
|
|
|
# frontend library, which uses momentjs.
|
2020-07-23 04:13:31 +00:00
|
|
|
CUSTOM_INPUT_FORMATS = [
|
2020-07-22 03:46:46 +00:00
|
|
|
'%m/%d/%Y %I:%M:%S %p', # '10/25/2006 2:30:59 PM'
|
|
|
|
'%m/%d/%Y %I:%M %p', # '10/25/2006 2:30 PM'
|
|
|
|
]
|
|
|
|
|
2021-08-06 15:24:07 +00:00
|
|
|
# Add custom "short" version of `MONTH_DAY_FORMAT`. This customization will
|
|
|
|
# only work with the locale format locale specified by this file.
|
2021-08-01 03:03:18 +00:00
|
|
|
SHORT_MONTH_DAY_FORMAT = 'M j'
|
|
|
|
|
2020-07-22 03:46:46 +00:00
|
|
|
# Append all other input formats from the base locale.
|
2020-07-23 04:13:31 +00:00
|
|
|
DATETIME_INPUT_FORMATS = CUSTOM_INPUT_FORMATS + formats.DATETIME_INPUT_FORMATS
|