You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Vuetify Version: 3.6.6 Vue Version: 3.4.27 Browsers: Chrome 124.0.0.0 OS: Mac OS 10.15.7
Steps to reproduce
Install Vue, Vuetify and the LuxonAdapter
Expected Behavior
The calendar to work and not report any errors.
Actual Behavior
Lots of date functions fail.
@date-io_luxon.js?v=aaaa9179:129 Uncaught (in promise) TypeError: date.hasSame is not a function
at LuxonUtils.isSameDay (@date-io_luxon.js?v=aaaa9179:129:19)
It seems the object type for each date argument is the generic Date object and not Luxon's DateTime. I can make the errors go away if I polyfill each function that the VCalendar component calls by doing the horribly hacky solution below (wrapping each instance of date with DateTime.fromJSDate...
// Create the adapter
let luxon = new LuxonAdapter({ locale: 'en', formats: CUSTOM_DATE_TIME_FORMATS } );
// Clone the broken functions
let isSameDay = luxon.isSameDay;
let startOfMonth = luxon.startOfMonth;
let getWeekArray = luxon.getWeekArray;
// Convert to luxon dates
luxon.isSameDay = ( date, comparing ) => isSameDay( DateTime.fromJSDate( date ), DateTime.fromJSDate( comparing ) );
luxon.startOfMonth = ( value) => startOfMonth( DateTime.fromJSDate( value ) );
// Export the completed function
export default luxon;
Any help on a fix or better workaround would be much appreciated. Thank you all!
The text was updated successfully, but these errors were encountered:
Environment
Vuetify Version: 3.6.6
Vue Version: 3.4.27
Browsers: Chrome 124.0.0.0
OS: Mac OS 10.15.7
Steps to reproduce
Install Vue, Vuetify and the LuxonAdapter
Expected Behavior
The calendar to work and not report any errors.
Actual Behavior
Lots of date functions fail.
Reproduction Link
https://play.vuetifyjs.com/#...
Other comments
It seems the object type for each date argument is the generic Date object and not Luxon's
DateTime
. I can make the errors go away if I polyfill each function that the VCalendar component calls by doing the horribly hacky solution below (wrapping each instance of date withDateTime.fromJSDate
...Any help on a fix or better workaround would be much appreciated. Thank you all!
The text was updated successfully, but these errors were encountered: