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
elgg_view input/date with timestamp on supports just one date format #7476
Comments
+1. Both input and output views should be able to take a format string. The input view should add format and other useful data-attributes, which should then be picked up by datepicker. |
They should also just do the most logical thing for the current locale... |
Maybe it is about time to elgg jump in into HTML5 specificiations, specially the "data-*" attributes. I will work on a fix to this, where "data-format-date" could be used as a parameter to the datepicker. If none, is passed, "yy-mm-dd" is assumed. |
Wouldn't jumping into html5 specifications mean using |
Should also consider #492 |
Okay, I had the time to look the problem more closely. The problem with the datepicker is this snippet in the 'ui.js' file, in the initDatePicker function: if (elgg.get_language() == 'en') { elgg.get_language() outputs 'pt_br' when the site is configured with Brazilian Portuguese language. But the name of the jquery i18n file for configuring datepicker regional settings is 'jquery.ui.datepicker-pt-BR'. So, what is the best solution to this? Renaming i18n file to 'jquery.ui.datepicker-pt_br'? |
I think normalizing the language code that get_language returns so that it points to the right file would be a better approach. |
yeah, but other parts of the application could be specting "pt_br" to be returned. I don't know why the i18n team just didn't stick with the convention. |
I meant something like this: normalizeLocaleToJqueryUiFormat(elgg.get_language()); |
As it is now, input/date just support the format 'yy-mm-dd'. Would be nice if it could be parameterized to support other formats more popular in other countries, like the format 'dd-mm-yy'.
The text was updated successfully, but these errors were encountered: