-
Notifications
You must be signed in to change notification settings - Fork 854
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dates to use browser or standard format #2185
Comments
What version you're on? |
Hi @githubsaturn, thanks for the prompt response, Ive updated the main comment with extra context: Im in the latest version:
|
Yes, this was supposed to fix that :/ |
To provide more context, we don't want to use the browser built-in version as it's just too long. That's why we're using moment. |
Yea, perhaps something like this could work: const date = new Date();
const options = {
year: 'numeric',
month: 'numeric',
day: 'numeric',
hour: '2-digit',
minute: '2-digit'
};
const formattedDate = date.toLocaleString('default', options);
console.log(formattedDate); |
Thanks! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Is your feature request related to a problem? Please describe.
Both a feature request and a problem, deploy dates are shown in american format, which is extremely confusing for non-american people as something like
will read as "eleven of march of 2024", when its actually "three of november of 2024"
Describe the solution you'd like
This and other dates to localize using the browser configuration or just use non-opinionated standard
YYYY/MM/DD
UPDATE: In case you were wondering, my locale is correctly set, and it correctly transforms dates coming as
YYYY/MM/DD
:I had a quick look at the frontend and maybe moment is not doing its job well here:
https://github.com/caprover/caprover-frontend/blob/master/src/containers/global/Timestamp.tsx#L12
The text was updated successfully, but these errors were encountered: