Skip to content

Commit

Permalink
FIO-6088: Fixing datetime issues with the calendar widget.
Browse files Browse the repository at this point in the history
  • Loading branch information
travist committed Dec 22, 2022
1 parent 3759fe3 commit af11bea
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
14 changes: 9 additions & 5 deletions src/components/_classes/component/Component.js
Original file line number Diff line number Diff line change
Expand Up @@ -1032,18 +1032,22 @@ export default class Component extends Element {
}

get timezone() {
if (this.component.timezone) {
return this.component.timezone;
return this.getTimezone(this.component);
}

getTimezone(settings) {
if (settings.timezone) {
return settings.timezone;
}
if (this.component.displayInTimezone === 'utc') {
if (settings.displayInTimezone === 'utc') {
return 'UTC';
}
const submissionTimezone = this.submissionTimezone;
if (
submissionTimezone &&
(
(this.component.displayInTimezone === 'submission') ||
((this.options.pdf || this.options.server) && (this.component.displayInTimezone === 'viewer'))
(settings.displayInTimezone === 'submission') ||
((this.options.pdf || this.options.server) && (settings.displayInTimezone === 'viewer'))
)
) {
return submissionTimezone;
Expand Down
2 changes: 1 addition & 1 deletion src/widgets/CalendarWidget.js
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ export default class CalendarWidget extends InputWidget {
}

get timezone() {
return this.componentInstance.timezone;
return this.componentInstance.getTimezone(this.settings);
}

get defaultSettings() {
Expand Down

0 comments on commit af11bea

Please sign in to comment.