Skip to content
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

Revisions to DatetimeField to have better HTML5 fallbacks #791

Merged
merged 11 commits into from
Jan 16, 2019

Conversation

bergice
Copy link
Contributor

@bergice bergice commented Dec 19, 2018

No description provided.

Copy link
Contributor

@maxime-rainville maxime-rainville left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks OK. However, I'm not sure what part of the issue we are trying to fix here.

That makes it difficult to actually test.

Copy link
Contributor

@maxime-rainville maxime-rainville left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When accessing the Uploaded, Last Edited dates in asset admin, I'm still getting the en_US format in all browsers.

The underlying issue appears to be coming from this commit. silverstripe/silverstripe-framework@33a013a

@bergice
Copy link
Contributor Author

bergice commented Jan 10, 2019

@maxime-rainville I think this could be happening because of the member locale:
image

Just tested on my computer and changing it seemed to fix the issue.

@bergice bergice force-pushed the pulls/1/date-locale-fix branch from daf3f46 to cebb382 Compare January 10, 2019 03:19
@maxime-rainville
Copy link
Contributor

maxime-rainville commented Jan 14, 2019

@bergice Tried siwtching to English UK and French. I'm always getting the date in en_US on this end.

@bergice
Copy link
Contributor Author

bergice commented Jan 14, 2019

@maxime-rainville could you try overriding the locale in your _config.php?

@maxime-rainville
Copy link
Contributor

There was a problem with MomentJS locale's not being loaded. They were included when the library was being compile without the -p flag. However, when compiled with it the Locale would be strip out to save space. So at run time, MomentJS would only know about en_US.

I added a bit of code to the Webpack config that copies all the local files to the dist folder. I added a Requirements call to LeftAndMain to load the Moment Loclaes based on the current default Locale for the project and the Member's Locale. This fix relies on silverstripe/silverstripe-framework#8726

@bergice
Copy link
Contributor Author

bergice commented Jan 15, 2019

@maxime-rainville I've made some further fixes on top of your fixes. Happy to merge this when you are.

@maxime-rainville
Copy link
Contributor

Everything is good. Failure is just cause because the lib hasn't been rebuild. I just rebuild locally and pushed up. I'll squash/merge on green.

@maxime-rainville maxime-rainville merged commit 2562d23 into silverstripe:1 Jan 16, 2019
@maxime-rainville maxime-rainville deleted the pulls/1/date-locale-fix branch January 16, 2019 05:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants