Skip to content

Commit

Permalink
Fixes a bug with date parsing on Safari
Browse files Browse the repository at this point in the history
Safari didn't like the string we made and frankly once we stopped using
"month only" this is what we should have done initially.

Related to Issue #38
  • Loading branch information
BobChao87 committed Nov 20, 2021
1 parent 667a287 commit d9a12d5
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions components/calendar/Controller.vue
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,7 @@ export default Vue.extend({
computed: {
datetime(): string {
const month = (this.month).toString().padStart(2, '0');
// Passing with time is important, otherwise it's handled as UTC.
return `${this.year}-${month}-01 00:00:00`;
return new Date(this.year, this.month - 1).toISOString();
},
previousCalendar(): CalendarLinkInfo {
return {
Expand Down

0 comments on commit d9a12d5

Please sign in to comment.