Forgot to commit this

This commit is contained in:
Lim Chee Aun 2024-09-22 13:54:43 +08:00
parent fd5e574e70
commit 4cc6a6a12c

View file

@ -8,11 +8,11 @@ const defaultLocale = mem(
);
const _DateTimeFormat = (opts) => {
const { locale, dateYear, hideTime, formatOpts } = opts || {};
const { locale, dateYear, hideTime, formatOpts, forceOpts } = opts || {};
const regionlessLocale = locale.replace(/-[a-z]+$/i, '');
const loc = localeMatch([regionlessLocale], [defaultLocale], locale);
const currentYear = new Date().getFullYear();
const options = {
const options = forceOpts || {
// Show year if not current year
year: dateYear === currentYear ? undefined : 'numeric',
month: 'short',