Update date-fns#9483
Conversation
| try { | ||
| dateString = formatDistanceToNow(date, { ...options }); | ||
| } catch (e) { | ||
| console.log(date); |
There was a problem hiding this comment.
maybe also console log the error, or is this just for testing?
There was a problem hiding this comment.
this is just for testing -- we haven't solved the issue yet 😭
| export default DS.Model.extend({ | ||
| type: attr('string', { | ||
| defaultValue: 'aes256-gcm96', | ||
| defaultValue: 'aes128-gcm96', |
There was a problem hiding this comment.
curious why we're lowing the bit count here (assuming the 256 stands for bits). I'm also guessing, the higher the bit count the more secure?
| <AlertBanner @type="warning" @message="We've stopped auto-renewing your token due to inactivity. | ||
| It will expire in {{date-from-now auth.tokenExpirationDate interval=1000 hideSuffix=true}}. | ||
| on {{date-format auth.tokenExpirationDate 'MMMM Do YYYY, h:mm:ss a'}}" /> | ||
| on {{date-format auth.tokenExpirationDate 'MMMM Do yyyy, h:mm:ss a'}}" /> |
There was a problem hiding this comment.
MMMM is capitalized, but yyyy is not?
There was a problem hiding this comment.
another excellent question! in the newest version of date-fnsyyyy (lowercase) represents the calendar year, which is what we want, whereas YYYY represents the week numbering year. see the examples here:
https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md#popular-mistakes
…dling of non-ISO date strings

Update date-fns
Update date-fns to 2.0.0 which requires us update all of our date-related helpers. The most notable change we had to account for is that all of the date-fns functions no longer accept strings as arguments. You'll notice we also had to switch some of the formatting arguments from
YYYYtoyyyyas a result. See the full list of breaking changes when upgrading to date-fns 2.0.0 here.Testing
This PR requires a considerable QA as it changes the behavior of our
date-from-nowanddate-formathelpers. We now return an empty string and console log an error if the formatting doesn't work, so there's a chance some dates may be missing in the UI.Navigate to the various pages of the UI where
date-formatordate-from-nowis used, such as the replication secondaries add modal which displays the expiration date. These pages should still display the date as expected.Here's an example of the replication secondaries add modal:
