I am trying to determine users locale date format so that I can use it later to show date in specific format.
I know I can use toLocaleDateString()
to get the date format.
Let's say I got 1/2/2017
. How to determine whether this is in dd/mm
format or mm/dd
format?
One thing I have tried is I can get current date and month from new Date()
and check based on that (manually). When the date is 2/2/2016
or 3/3/2016
how to determine which one is date and which one is month?
Is there any solution anybody has for this issue?
Also I have looked into moment.js
. If some solution available there also I will be happy to use that.