-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Provide a way to switch back to default (en) locale #2687
Comments
I don't follow. The locale can be set per picker or globally and the |
Take this code: import { TempusDominus, loadLocale, locale } from '@eonasdan/tempus-dominus';
import { localization, name } from "@eonasdan/tempus-dominus/dist/locales/it";
loadLocale({localization, name});
locale('it');
const td = new TempusDominus(document.getElementById('datetimepicker1')); Now that the global locale is |
Can do |
That does change the displayed language in the main picker (which I assume uses |
OOH. I see. Since you said locale, I thought you where talking about Right so setting it globally replaces the defaultoptions and thus there is no way to revert that. Hmm. I could create an en-Us locale file that could be loaded. That seems heavy though. |
Update, I tried doing this at startup (no global TD locale, browser in loadLocale({ localization: DefaultOptions.localization, name: "en-us" }); which partially works since it sets tooltips and day of week, but not those parts which depend on I also anticipate the need of an |
To set locale globally to English:
To test: Open DevTools in Chrome -> Open the Console drawer. Click on the three-dotted menu -> Click on More tools -> Sensors. From the Sensors tab, set the location according to your preference. Before: after setting : I have to mention one problem with localization when using CustomDateFormat plugin: the English format is always used even in cultures like 'fr' |
Hello 6.7.7 should resolve this. There's an additional export |
* Fix #2788 (#2790) Break if current range-start is clicked to prevent infinite loop * adding placement option (#2789) * fixes #2785 (#2797) * fixes #2785 fixes #2783 fixes #2768 improves docs flow * fixed plugin/locale missing type defs * 2791 more tests (#2800) * validation tests * update datetime tests * "dates" tests * actions tests * fixing infinity loop bug in date range (#2798) * Improvements (#2801) * fixes #2795 * fixes #2784 * fixes #2687 * fixes #2786 * resolves #2764 * fix repl cdn links * fix date range bug * version 6.7.7 * version 6.7.7 --------- Co-authored-by: iTzVirtual_ <[email protected]> Co-authored-by: Killian Hale <[email protected]> Co-authored-by: GitHub User <[email protected]>
* Fix #2788 (#2790) Break if current range-start is clicked to prevent infinite loop * adding placement option (#2789) * fixes #2785 (#2797) * fixes #2785 fixes #2783 fixes #2768 improves docs flow * fixed plugin/locale missing type defs * 2791 more tests (#2800) * validation tests * update datetime tests * "dates" tests * actions tests * fixing infinity loop bug in date range (#2798) * Improvements (#2801) * fixes #2795 * fixes #2784 * fixes #2687 * fixes #2786 * resolves #2764 * fix repl cdn links * fix date range bug * version 6.7.7 * version 6.7.7 --------- Co-authored-by: iTzVirtual_ <[email protected]> Co-authored-by: Killian Hale <[email protected]> Co-authored-by: GitHub User <[email protected]>
Prerequisites
Proposal
I think there should be a way to explicitly set the locale of a single picker to the library default (en / en-US), which does not seem possible at the moment.
Motivation and context
This is relevant in the following cases:
The text was updated successfully, but these errors were encountered: