-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Standardized Date and Time #5533
Standardized Date and Time #5533
Conversation
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/eventyay/open-event-frontend/lc0wwjz9w |
@@ -116,10 +116,10 @@ export default Component.extend(FormMixin, EventWizardMixin, { | |||
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); | |||
event.startsAt = moment.tz(event.startsAt.clone().tz(oldTimezone).format('DD MMMM, YYYY hh:mm A'), moment.ISO_8601, this.data.event.timezone); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not user facing format. This is ISO8601 format and it needs to remain same
app/components/schedule.hbs
Outdated
@@ -15,10 +15,10 @@ | |||
@viewName="agendaDay" | |||
@defaultView="timelineDay" | |||
@validRange={{this.validRange}} | |||
@now={{moment-format (now) "YYYY-MM-DD"}} | |||
@now={{moment-format (now) "DD-MM-YYYY"}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not user facing format. This needs to be passed in the exact same way to the component
app/components/schedule.hbs
Outdated
@scrollTime="0:00:00" | ||
@slotDuration="00:05:00" | ||
@slotLabelFormat="HH:mm" | ||
@slotLabelFormat="hh:mm A" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same. This should not be changed
Okay, and apart from these three are there any other corrections needed? |
@mariobehling Please check |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you very much! This is a huge improvement and seeing your changes I believe it would be even better, if we could further limit this to only two formats. Here is the list below.
Please do not add a "0" in front of single digit date or time formats.
- This is good for tables:
Make event format as in this example: 4 Dec, 2020 5:00 PM (IST)
- table https://eventyay.com/events
- table https://eventyay.com/admin/events
- table https://eventyay.com/admin/sales
- table https://eventyay.com//admin/users/
- table event orders table /events/[event ID]/tickets/orders
- table event attebdees /events/[event ID]/tickets/attebdees
- table session overview page events/[event ID]/sessions/all
- This is good for most public pages
Make event format as in this example: Friday, 4 December, 2020 5:00 PM (IST)
- tickets overview https://eventyay.com/my-tickets/past
- ticket order https://eventyay.com/orders/[order number here]
- events dashboard /events/[events ID]
- public events page header e/[eventpage], e.g. https://eventyay.com/e/a315169f
- public events page ticket section, e.g. https://eventyay.com/e/a315169f#tickets
- public events page calendar section
- call for speakers, e.g. https://eventyay.com/e/a315169f/cfs
- Am I missing something important? Please share if any.
4 Dec, 2020 |
app/components/schedule.hbs
Outdated
@@ -18,7 +18,7 @@ | |||
@now={{moment-format (now) "YYYY-MM-DD"}} | |||
@scrollTime="0:00:00" | |||
@slotDuration="00:05:00" | |||
@slotLabelFormat="HH:mm" | |||
@slotLabelFormat="HH:MM" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Again, this is not for public display.
@@ -465,7 +465,7 @@ export default Component.extend(FormMixin, EventWizardMixin, { | |||
eventStartDate = moment(new Date(eventStartDate)); | |||
this.data.event.tickets.forEach(ticket => { | |||
if (moment(eventStartDate).isBefore(ticket.get('salesEndsAt'))) { | |||
ticket.set('salesEndsAt', moment(eventStartDate, 'MM/DD/YYYY').toDate()); | |||
ticket.set('salesEndsAt', moment(eventStartDate, 'DD-MMMM-YYYY').toDate()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, where did this format come from? And this is not for public display
Please don't change formats which are used for parsing and not for display |
So should I only change hbs and not js? |
JS contains display formats as well. And the build is failing. The initial work was much more stable. I don't know what triggered the need for editing each file one at a time. You already had another PR ready. You could just force push the changes on this branch |
4f2d778
to
6478761
Compare
I have forced pushed the changes from other PR to this. Please delete the local branch and fetch again to continue the work. git checkout development
git branch -D branchNew
git fetch origin branchNew
git checkout branchNew |
It is a display format |
b16b8c6
to
085b778
Compare
Hi, would be great if this PR gets finalized. As this PR is blocking others from resolving the issue, we would close it in the upcoming days if there is no activity. You already contributed a good amount of time to this PR, so I think with some more effort you could finalize it. Keep it up! |
be0ddb8
to
085b778
Compare
79552f2
to
79f9880
Compare
Codecov Report
@@ Coverage Diff @@
## development #5533 +/- ##
===============================================
- Coverage 23.71% 23.60% -0.12%
===============================================
Files 510 510
Lines 5422 5422
Branches 59 59
===============================================
- Hits 1286 1280 -6
- Misses 4121 4126 +5
- Partials 15 16 +1
Continue to review full report at Codecov.
|
app/helpers/header-date.js
Outdated
@@ -3,7 +3,7 @@ import moment from 'moment'; | |||
|
|||
export function headerDate(params) { | |||
const timezone = params[1] ? params[1] : moment.tz.guess(); | |||
return `${moment(params[0]).tz(timezone).format('dddd, D MMMM, YYYY h:mm A')} (${moment.tz(params[0], timezone).zoneAbbr()})`; | |||
return `${moment(params[0]).tz(timezone).format('dddd, MMMM Do YYYY, h:mm A')} (${moment.tz(params[0], timezone).zoneAbbr()})`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why reverted the format here? We need same format everywhere
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was the only way for the build to be successful.
Changing it was failing the build every time.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, that's not the only way to fix the build
This has been resolved already elsewhere now. Thank you |
Fixes #5490
Short description of what this resolves:
All the occurrence of dates and time has been converted to only 5 formats
Changes proposed in this pull request:
Since there were more than 20 formats used all over the platform, I've minimized it to use only 5 formats.
Five formats that are used everywhere including all .js files and .hbs files are:-
Checklist
development
branch.