Skip to content

Commit

Permalink
Fixed intercalary month only calendars breaking
Browse files Browse the repository at this point in the history
  • Loading branch information
Haxxer committed Nov 25, 2021
1 parent 6b712db commit 45e6cd3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
5 changes: 3 additions & 2 deletions public/changelog.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
### 2.1.4 - WHAT Djinn
#### November xxth, 2021
### 2.1.4 - Investigative Djinn
#### November 25th, 2021
* Added - Warning under seasons when a custom location with custom sunrise and sunset times is active
* Fixed - Locking a custom location's sunrise and sunset times would cause it to not be saved correctly
* Fixed - Calendars with only intercalary months would fail to build

### 2.1.3 - Curious Djinn
#### November 16th, 2021
Expand Down
4 changes: 1 addition & 3 deletions resources/js/calendar/calendar_workers.js
Original file line number Diff line number Diff line change
Expand Up @@ -871,9 +871,7 @@ const calendar_data_generator = {
const start_epochs = Object.keys(first_timespan.epochs);
const end_epochs = Object.keys(last_timespan.epochs);

const first_nonintercalary_timespan = timespans_to_build.filter(timespan => !timespan.intercalary)[0];
const first_nonintercalary_epoch = Object.entries(first_nonintercalary_timespan.epochs)[0][1];
const calendar_week_day = first_nonintercalary_epoch.week_day;
const calendar_week_day = Object.values(this.epochs).find(epoch => epoch.year === this.current_year && epoch.week_day) ?? 0;

const calendar_start_epoch = Number(start_epochs[0]);
const calendar_end_epoch = Number(end_epochs[end_epochs.length - 1]);
Expand Down

0 comments on commit 45e6cd3

Please sign in to comment.