In my project the selection of browser locale I want to change the date format, how can I get the date format according to the locale in javascript or angularjs
How to load a json file based on locale of the browser in angular1.x?
107 Views Asked by Ahmed Ahmed At
1
There are 1 best solutions below
Related Questions in DATE-FORMAT
- Crash parsing date strings but only on some iOS devices
- change java.util.Date format
- JQuery Datepicker display date format
- MySQL STR_TO_DATE returns NULL when using week number directive (%U, %u, %V or %v)
- converting date to new format not working using strtotime()
- d3js Dateformat: Hours, Minutes and Seconds incorrect
- Trying to show only year from a date stored in mongodb database. How to do that?
- Convert date column to date format and extract month and year
- XMLGregorianCalendar with 6 milliseconds
- Microsoft dateformat add 1 to yyyy
- Trim and Format Date Axis Formatting for Dataframe in HeatMap
- to get the instance count of a certain period via LaunchTime wrt Powershell
- Java 11 ZonedDateTime - Print Format
- Getting 0 results when I use BETWEEN DATEADD(MONTH,-4,CURRENT_DATE) AND DATEADD(MONTH,-1,CURRENT_DATE)
- Unable to convert String to LocalDateTime format "YYYYMMDDhhmmss" (week year) pattern with (day of month)
Related Questions in SETLOCALE
- Android API>33 set locale from device settings + black screen
- I am encountering an issue when running my Django project inside a Docker container using the Python 3.11.1 image
- How does one install and test Windows locales in support of `set locale()` in the GitHub Windows runner?
- Use multiple locales in R ShinyApp deployed to shinyapps.io
- Android Studio set Locale not working in any file just MainActivity
- Compiled program can't display special characters
- How to change the default language and add it_IT.UTF-8 locale to locale.gen on Azure?
- php setLocale fails, but that locale is installed on my server
- C++ std::locale::global - using in a DLL affects calling program?
- Java set locale permanently
- Cakephp I18n setLocale doesn't change language
- std::stringstream gets broken after setting UTF8 locale
- Python calendar on Windows: unsupported locale setting
- Format a thousand separator in C with FreeBSD
- MSVCRT printf never do thousand separator grouping, right?
Related Questions in ANGULAR-DATE-FORMAT
- If user enter incorrect date and we have a date in previousDate variable then previousdate should be set on input textbox
- Angular Matrial DateInput Harness returns value in wrong format
- Dynamically change of date and number pipe default format
- Checkbox confirmation button missing from ngx mat date time picker
- Angular & PrimeNg Datepicker (p-calendar): Disable future dates
- set DATE_PIPE_DEFAULT_TIMEZONE with useFactory
- Angular MAT_DATE_FORMATS change values at runtime (FIXED)
- how to translate angular datePipe's dates with moment.js?
- Angular8 Date Convert
- Angular conditional date pipe
- Angular custom date format adapted to locale
- Angular: input type="date" with initial value
- Angular Material DatePicker Allow String value
- Angular Date Formatting add the 'at' before time
- Angular DatePipe transform while patching values
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular # Hahtags
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
in order to detect user time format you can use Moment.js.
after including moment.js library, first detect user locale by this javascript code :
let user_locale = window.navigator.userLanguage || window.navigator.language;then feed the user_locale value to
moment.locale();function like thismoment.locale(user_locale);after declaring localData
let localeData = moment.localeData()you can use LongDateFormat
localeData.longDateFormat(dateFormat); // returns the full format of abbreviated date-time formats LT, L, LL and so onto get time format.