Skip to content

Commit

Permalink
fix: fix subscription timezone logic (#32536)
Browse files Browse the repository at this point in the history
  • Loading branch information
NawfalAhmed authored Jun 21, 2023
1 parent 597a1f1 commit 28ebe52
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,9 @@ class ProgramSubscriptionModel extends Backbone.Model {
return ['', ''];
}

const userTimezone = userPreferences.time_zone || 'UTC';
const userTimezone = (
userPreferences.time_zone || moment.tz.guess() || 'UTC'
);
const userLanguage = userPreferences['pref-lang'] || 'en';
const context = {
datetime: date,
Expand All @@ -102,7 +104,9 @@ class ProgramSubscriptionModel extends Backbone.Model {
return 0;
}

const userTimezone = userPreferences.time_zone || 'UTC';
const userTimezone = (
userPreferences.time_zone || moment.tz.guess() || 'UTC'
);
const trialEndTime = DateUtils.localizeTime(
DateUtils.stringToMoment(trialEndDate),
userTimezone
Expand Down

0 comments on commit 28ebe52

Please sign in to comment.