quasar-ui-qcalendar
quasar-ui-qcalendar copied to clipboard
fix(ui): use correct type definitions for createNativeLocaleFormatter…
trafficstars
This addresses typescript compiling errors when using the createNativeLocaleFormatter function per the examples in the documentation. The return type of this function is a function, not a string.
Tested this fix on my project, which uses the following snippets of code (taken from docs/src/examples/DayCustomHeader.vue):
<div style="width: 100%; font-size: 0.9em">
{{ monthFormatter(day, true) }}
</div>
const monthFormatter = monthFormatterFunc(),
function monthFormatterFunc() {
const longOptions: Intl.DateTimeFormatOptions = {
timeZone: 'UTC',
month: 'long',
};
const shortOptions: Intl.DateTimeFormatOptions = {
timeZone: 'UTC',
month: 'short',
};
return createNativeLocaleFormatter(locale.value, (_tms, short) =>
short ? shortOptions : longOptions
);
}```
… (#439)