quasar-ui-qcalendar icon indicating copy to clipboard operation
quasar-ui-qcalendar copied to clipboard

Use quasar.lang as default for weekdays and hour24-format

Open rogeru opened this issue 2 years ago • 1 comments

Quasar components such as q-date use the quasar.lang.date (language pack) to determine whether to use 24h format, or starting day of the week. It would be great if the calendar would do the same, rather than having to set weekdays and hour24-format manually based on the locale.

https://quasar.dev/options/quasar-language-packs

rogeru avatar Apr 27 '22 13:04 rogeru

QCalendar uses Intl.DateTimeFormat for everything calendar. We can try and use Intl to find out the hour format and use that as a default if the dev hasn't used the prop to explicitly define it. Equally, devs can also do this and set the prop based on the outcome. We can do the same for locale, instead of defaulting to 'en-US'

References: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/hourCycle https://devhints.io/wip/intl-datetime

hawkeye64 avatar Apr 28 '22 20:04 hawkeye64