Skip to content

Commit

Permalink
Merge pull request #1140 from PlanoramaEvents/staging
Browse files Browse the repository at this point in the history
v3.7.2
  • Loading branch information
balen authored Jul 22, 2024
2 parents 3c1c769 + 939798c commit 8acf2d0
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions app/javascript/shared/convention-timezone.mixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,18 @@ export const conventionTimezoneMixin = {
conventionTimezone() {
return this.currentSettings?.configs?.find(c => c.parameter === 'convention_timezone')?.parameter_value || 'UTC'
},
/*
NOTE: both the start and end days needs to be in the convention timezone. Otherwise if the users
computer's timezone is sufficiently different than the cons (like 8 or more hours) the days will
be off by one.
*/
conventionStart() {
const val = this.currentSettings?.configs?.find(c => c.parameter === 'convention_start_time')?.parameter_value;
return val ? DateTime.fromISO(val) : DateTime.now();
return val ? DateTime.fromISO(val).setZone(this.conventionTimezone) : DateTime.now();
},
conventionEnd() {
const val = this.currentSettings?.configs?.find(c => c.parameter === 'convention_end_time')?.parameter_value;
return val ? DateTime.fromISO(val) : DateTime.now();
return val ? DateTime.fromISO(val).setZone(this.conventionTimezone) : DateTime.now();
},
daysArray() {
let numDays = Math.ceil(this.conventionEnd.diff(this.conventionStart).as('days'));
Expand Down

0 comments on commit 8acf2d0

Please sign in to comment.