techouse / intl-date-time

International DateTime for Laravel Nova
MIT License
57 stars 21 forks source link

Implement different Dateformat #45

Closed Jun-ocx closed 3 years ago

Jun-ocx commented 3 years ago

in my project, I want it to show in the format as "MM/DD/YYYY" in US I've tried

->format('MM-DD-YYYY)
->format('MM/DD/YYYY)
->dateFormat('MM-DD-YYYY')
->dateFormat('MM/DD/YYYY')

none of them is working

->dateFormat('MM/DD/YYYY') seems to work but gives an error message: The Expires must be in the format dd/MM/yyyy

Screen Shot 2021-01-19 at 1 46 28 PM

also when I try to use it with ->minDate(Carbon::now()), it gives the totally wrong date to start with

Screen Shot 2021-01-19 at 1 48 08 PM

techouse commented 3 years ago

Hey!

As this module extracts locales from MomentJS it only supports locales that MomentJS supports and en-US is not one of them. This is a known bug of MomentJS that hasn't been fixed in over 2 years.