Skip to content
This repository has been archived by the owner on Oct 22, 2020. It is now read-only.

add date to disclosure page #519

Closed
jsms90 opened this issue Aug 22, 2018 · 3 comments · Fixed by #543
Closed

add date to disclosure page #519

jsms90 opened this issue Aug 22, 2018 · 3 comments · Fixed by #543
Assignees
Labels
Client-Side Any issue regarding the look / behaviour of the application in the browser.

Comments

@jsms90
Copy link
Contributor

jsms90 commented Aug 22, 2018

Product requirements:

  • Show author the date based on their timezone

Designs:
wizard-screen-5 2x

Current:
image

Potential options:

@jsms90 jsms90 added the Client-Side Any issue regarding the look / behaviour of the application in the browser. label Aug 22, 2018
@jsms90 jsms90 self-assigned this Aug 22, 2018
@jsms90 jsms90 added this to To Do in xPub Project via automation Aug 22, 2018
@jsms90 jsms90 moved this from To Do to In Progress in xPub Project Aug 22, 2018
@jsms90 jsms90 moved this from In Progress to To Do in xPub Project Aug 23, 2018
@jsms90
Copy link
Contributor Author

jsms90 commented Aug 23, 2018

We had a discussion at standup about the product requirements for this. Showing the date based on the user's timezone seems to be a best guess for now. But we're aware that the journal only shows GMT publication dates, so there was a questions around whether we would want to show a different date to the author within the wizard.

The suggestion here is to add a date library to the project & go with author's timezone for now, with the understanding that product requirements may change.

@hem-brahmbhatt hem-brahmbhatt moved this from To Do to In Progress in xPub Project Aug 30, 2018
@jsms90
Copy link
Contributor Author

jsms90 commented Aug 30, 2018

Having had a brief look into date libraries this afternoon. Started with comparing Moment.js & date-fns:

Well, according to Sasha Koss, the creator of date-fns, Moment.js has a few inherent problems which motivated him to create date-fns. Sasha expands on what these problems are on the project’s GitHub page, but in a nutshell:

Moment.js is mutable which can cause bugs.

  • It has a complex OOP API (which doubles the mutability problem).
  • It has a performance overhead due to the complex API.
  • Its build size is large when used with Webpack, as locale files are included as part of the bundle.

Let’s contrast that with date-fns (taken from the project’s homepage):

Date-fns is immutable, always returning a new date instead of changing the one you pass in.

  • It has a simple API. You always have one function that does one thing.
  • It is fast. You can be sure that your users will have the best user experience.
  • It is the perfect companion for Webpack. With the function-per-file style you can pick just what you need and stop bloating your project with useless functionality.

One thing that stands out as a potential problem though is in the "time zones" section of that article:

Time zones

One disadvantage of date-fns is that it doesn’t currently have any time zone helper functions like Moment.js does.

May not actually be an issue - will need to look into this properly next week. But may depend on what our product requirements are in the end. Especially if we don't end up showing the author the date based on their own timezone, date-fns is looking pretty good.

@jsms90 jsms90 moved this from In Progress to To Do in xPub Project Aug 30, 2018
@hdrury1
Copy link
Contributor

hdrury1 commented Sep 3, 2018

Especially if we don't end up showing the author the date based on their own timezone, date-fns is looking pretty good.

Product requirements are that any user-facing feature displays date/time in user's zone.

@jsms90 jsms90 moved this from To Do to In Progress in xPub Project Sep 3, 2018
@jsms90 jsms90 moved this from In Progress to In Review in xPub Project Sep 3, 2018
xPub Project automation moved this from In Review to Done Sep 3, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Client-Side Any issue regarding the look / behaviour of the application in the browser.
Projects
xPub Project
  
Done
Development

Successfully merging a pull request may close this issue.

2 participants