We are currently using hard coded date formats in various D3 charts. We should things like "%Y-%m-%dT%H:%M:%S" scattered throughout the code. We should really be using Django's date format. Here are a few of the formats available:
As you can see, the hard-coded format is very similar to django.formats.DATE_TIME_INPUT_FORMATS[0]. Why do we wan to do this? Django handles internationalization for us, so it make sense to take advantage of this. It will also centralize the hard-coded date formats into a single place.
We are currently using hard coded date formats in various D3 charts. We should things like "%Y-%m-%dT%H:%M:%S" scattered throughout the code. We should really be using Django's date format. Here are a few of the formats available:
django.formats = { FORMAT" : "N j, Y, P", INPUT_FORMATS" : [
"DATETIME_
"DATETIME_
"%Y-%m-%d %H:%M:%S",
"%Y-%m-%d %H:%M:%S.%f",
"%Y-%m-%d %H:%M",
"%Y-%m-%d",
"%m/%d/%Y %H:%M:%S",
"%m/%d/%Y %H:%M:%S.%f",
"%m/%d/%Y %H:%M",
"%m/%d/%Y",
"%m/%d/%y %H:%M:%S",
"%m/%d/%y %H:%M:%S.%f",
"%m/%d/%y %H:%M",
"%m/%d/%y"
]
As you can see, the hard-coded format is very similar to django. formats. DATE_TIME_ INPUT_FORMATS[ 0]. Why do we wan to do this? Django handles internationaliz ation for us, so it make sense to take advantage of this. It will also centralize the hard-coded date formats into a single place.