Skip to content
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

Updating date-fns library from 1.x to 2.x #10848

Merged
merged 9 commits into from
Feb 8, 2021

Conversation

Monkeychip
Copy link
Contributor

We need to update this library to take advantage of the new methods available in version 2.^ for the Database Secret Engine project.

Worked through the breaking changes according to the date-fns changelog, but also issues that came up in the failed test. For example, AM/PM from A to a.

@Monkeychip Monkeychip added the ui label Feb 5, 2021
@Monkeychip Monkeychip added this to the 1.7 milestone Feb 5, 2021
Copy link
Contributor

@chelshaw chelshaw left a comment

Choose a reason for hiding this comment

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

A couple things to double-check, but thanks for making all these updates!

// TODO: minStart, maxEnd
let params = {};
if (start) {
let startDate = parseDateString(start);
if (startDate) {
// TODO: Replace with formatRFC3339 when date-fns is updated
params.start_time = format(addDays(startDate, 1), 'X');
// converts to milliseconds, divide by 1000 to get epoch
params.start_time = getTime(startDate) / 1000;
Copy link
Contributor

Choose a reason for hiding this comment

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

Pretty sure we added days because there was some weirdness with UTC, but if the tests pass with this update we should be ok

ui/app/templates/components/license-info.hbs Show resolved Hide resolved
ui/tests/integration/helpers/date-from-now-test.js Outdated Show resolved Hide resolved
Copy link
Contributor

@chelshaw chelshaw left a comment

Choose a reason for hiding this comment

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

Great work! Thanks for tackling this

@@ -14,4 +17,31 @@ module('Integration | Helper | date-from-now', function(hooks) {
let result = dateFromNow([1481022124443], { addSuffix: true });
assert.ok(result.includes(' ago'));
});

test('you can pass in UTC timestamp', function(assert) {
Copy link
Contributor

Choose a reason for hiding this comment

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

👏

@vercel vercel bot temporarily deployed to Preview – vault February 8, 2021 18:39 Inactive
@vercel vercel bot temporarily deployed to Preview – vault-storybook February 8, 2021 18:39 Inactive
@Monkeychip Monkeychip merged commit 0a20750 into master Feb 8, 2021
@Monkeychip Monkeychip deleted the ui/date-fns-breaking-upgrade branch February 8, 2021 20:13
@hashishaw hashishaw mentioned this pull request Aug 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants