Skip to content

Commit

Permalink
Merge pull request #1139 from PlanoramaEvents/development
Browse files Browse the repository at this point in the history
3.7.1-rc1
  • Loading branch information
balen authored Jul 21, 2024
2 parents 58fae01 + b07ed3c commit 939798c
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 939798c

Please sign in to comment.