Replace hard-coded date formats with Django formats
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Dashboard (Horizon) |
In Progress
|
Undecided
|
Thai Tran |
Bug Description
We are currently using hard coded date formats in various D3 charts. We have 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 = {
"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.
People in different locale read dates differently. For example,
In english: "%Y-%m-%d %H:%M:%S"
In spanish: "%d/%m/%Y %H:%M:%S"
Changed in horizon: | |
assignee: | nobody → Thai Tran (tqtran) |
summary: |
- Remove hard-coded date formats + Replace hard-coded date formats with Django formats |
description: | updated |
description: | updated |
tags: | added: i18n |
Fix proposed to branch: master /review. openstack. org/116686
Review: https:/