From e583b47249d5992732ebfb1f4edbd0f64bed349c Mon Sep 17 00:00:00 2001 From: sundaram Date: Sun, 4 Oct 2020 22:00:24 +0530 Subject: [PATCH 1/2] timezone issue on wizard step 1 --- app/components/forms/wizard/basic-details-step.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/app/components/forms/wizard/basic-details-step.js b/app/components/forms/wizard/basic-details-step.js index 3031ef98e37..4577aaee10b 100644 --- a/app/components/forms/wizard/basic-details-step.js +++ b/app/components/forms/wizard/basic-details-step.js @@ -110,6 +110,20 @@ export default Component.extend(FormMixin, EventWizardMixin, { return this.data.event.tickets.toArray().filter(ticket => ticket.type === 'paid' || ticket.type === 'donation').length > 0; }), + timezoneObserver: observer('data.event.timezone', function() { + const { event } = this.data; + const { oldTimezone } = this; + this.oldTimezone = this.data.event.timezone; + if (!oldTimezone || !this.oldTimezone || oldTimezone === this.oldTimezone) + return; + if (event.startsAt) { + event.startsAt = moment.tz(event.startsAt.clone().tz(oldTimezone).format('YYYY-MM-DDTHH:mm:ss.SSS'), moment.ISO_8601, this.data.event.timezone); + } + if (event.endsAt) { + event.endsAt = moment.tz(event.endsAt.clone().tz(oldTimezone).format('YYYY-MM-DDTHH:mm:ss.SSS'), moment.ISO_8601, this.data.event.timezone); + } + }), + discountCodeObserver: observer('data.event.discountCode', function() { this.getForm().form('remove prompt', 'discount_code'); }), From 0b089900ebdeb550787bdfe760cf25165ec03c54 Mon Sep 17 00:00:00 2001 From: sundaram Date: Sun, 4 Oct 2020 22:19:10 +0530 Subject: [PATCH 2/2] fix the fix to be fixed by this fix --- app/components/forms/wizard/basic-details-step.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/components/forms/wizard/basic-details-step.js b/app/components/forms/wizard/basic-details-step.js index 4577aaee10b..352790f9bcd 100644 --- a/app/components/forms/wizard/basic-details-step.js +++ b/app/components/forms/wizard/basic-details-step.js @@ -114,8 +114,7 @@ export default Component.extend(FormMixin, EventWizardMixin, { const { event } = this.data; const { oldTimezone } = this; this.oldTimezone = this.data.event.timezone; - if (!oldTimezone || !this.oldTimezone || oldTimezone === this.oldTimezone) - return; + if (!oldTimezone || !this.oldTimezone || oldTimezone === this.oldTimezone) {return} if (event.startsAt) { event.startsAt = moment.tz(event.startsAt.clone().tz(oldTimezone).format('YYYY-MM-DDTHH:mm:ss.SSS'), moment.ISO_8601, this.data.event.timezone); }