Skip to content

Formatting launch time when the exact time is not yet known#2

Open
squatica wants to merge 1 commit into
warwickbuilds:masterfrom
squatica:master
Open

Formatting launch time when the exact time is not yet known#2
squatica wants to merge 1 commit into
warwickbuilds:masterfrom
squatica:master

Conversation

@squatica
Copy link
Copy Markdown

No description provided.

@warwickbuilds warwickbuilds self-assigned this Aug 10, 2020
Copy link
Copy Markdown
Owner

@warwickbuilds warwickbuilds left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really appreciate you showing how this could be done with dates, I've updated the page to use V4 of the API and implemented a few checks for non-locked in date/time similar to what you have shown.

Looking to see how I would like to implement your date formatting into the new version.

Thanks again!

@squatica
Copy link
Copy Markdown
Author

squatica commented Sep 5, 2020

Hi, I added the formatDate function also for the newest version. Currently it shows the launchpad local time in the upcoming list, although I'm not sure if that's really helpful for users. Maybe it would be better to clarify it somewhere, or always show the user's local time or always show UTC just to avoid confusion.

The imprecise dates are always constructed based on the UTC time, because for example if the launch should happen in December, the API will return midnight of December 1st as the UTC time, but the launchpad local time will be -5, so that will fall into November, therefore we cannot use that for the imprecise date formatting. The only case where a distinction between user's local time and launchpad local time is useful is if precision is "hour".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants