mirror of
https://github.com/SomboChea/ui
synced 2024-12-24 21:24:26 +07:00
feat: update date fns to v2 (#232)
* chore: updates date-fns@2 * chore: updates date-fns@2 to new apis * chore: updates date-fns@2, updates format
This commit is contained in:
parent
0eb0566cde
commit
a4cdd145d2
@ -3,7 +3,7 @@
|
||||
*/
|
||||
|
||||
import { Base64 } from 'js-base64';
|
||||
import addHours from 'date-fns/add_hours';
|
||||
import addHours from 'date-fns/addHours';
|
||||
|
||||
export function generateTokenWithTimeRange(limit = 0) {
|
||||
const payload = {
|
||||
|
@ -45,7 +45,7 @@
|
||||
"concurrently": "5.0.0",
|
||||
"cross-env": "6.0.3",
|
||||
"css-loader": "3.2.0",
|
||||
"date-fns": "1.30.1",
|
||||
"date-fns": "2.6.0",
|
||||
"detect-secrets": "1.0.4",
|
||||
"emotion": "9.2.12",
|
||||
"enzyme": "3.10.0",
|
||||
|
@ -3,11 +3,11 @@ import { isObject } from 'util';
|
||||
import { UpLinks } from '@verdaccio/types';
|
||||
import isString from 'lodash/isString';
|
||||
import format from 'date-fns/format';
|
||||
import distanceInWordsToNow from 'date-fns/distance_in_words_to_now';
|
||||
import formatDistanceToNow from 'date-fns/formatDistanceToNow';
|
||||
|
||||
import { Time } from '../../types/packageMeta';
|
||||
|
||||
export const TIMEFORMAT = 'DD.MM.YYYY, HH:mm:ss';
|
||||
export const TIMEFORMAT = 'dd.MM.yyyy, HH:mm:ss';
|
||||
|
||||
/**
|
||||
* Formats license field for webui.
|
||||
@ -56,7 +56,7 @@ export function formatDate(lastUpdate: string | number): string {
|
||||
}
|
||||
|
||||
export function formatDateDistance(lastUpdate: Date | string | number): string {
|
||||
return distanceInWordsToNow(new Date(lastUpdate));
|
||||
return formatDistanceToNow(new Date(lastUpdate));
|
||||
}
|
||||
|
||||
/**
|
||||
|
12
yarn.lock
12
yarn.lock
@ -4526,16 +4526,16 @@ data-urls@^1.0.0, data-urls@^1.1.0:
|
||||
whatwg-mimetype "^2.2.0"
|
||||
whatwg-url "^7.0.0"
|
||||
|
||||
date-fns@1.30.1, date-fns@^1.27.2:
|
||||
version "1.30.1"
|
||||
resolved "https://registry.verdaccio.org/date-fns/-/date-fns-1.30.1.tgz#2e71bf0b119153dbb4cc4e88d9ea5acfb50dc05c"
|
||||
integrity sha512-hBSVCvSmWC+QypYObzwGOd9wqdDpOt+0wl0KbU+R+uuZBS1jN8VsD1ss3irQDknRj5NvxiTF6oj/nDRnN/UQNw==
|
||||
|
||||
date-fns@^2.0.1:
|
||||
date-fns@2.6.0, date-fns@^2.0.1:
|
||||
version "2.6.0"
|
||||
resolved "https://registry.verdaccio.org/date-fns/-/date-fns-2.6.0.tgz#a5bc82e6a4c3995ae124b0ba1a71aec7b8cbd666"
|
||||
integrity sha512-F55YxqRdEfP/eYQmQjLN798v0AwLjmZ8nMBjdQvNwEE3N/zWVrlkkqT+9seBlPlsbkybG4JmWg3Ee3dIV9BcGQ==
|
||||
|
||||
date-fns@^1.27.2:
|
||||
version "1.30.1"
|
||||
resolved "https://registry.verdaccio.org/date-fns/-/date-fns-1.30.1.tgz#2e71bf0b119153dbb4cc4e88d9ea5acfb50dc05c"
|
||||
integrity sha512-hBSVCvSmWC+QypYObzwGOd9wqdDpOt+0wl0KbU+R+uuZBS1jN8VsD1ss3irQDknRj5NvxiTF6oj/nDRnN/UQNw==
|
||||
|
||||
date-now@^0.1.4:
|
||||
version "0.1.4"
|
||||
resolved "https://registry.verdaccio.org/date-now/-/date-now-0.1.4.tgz#eaf439fd4d4848ad74e5cc7dbef200672b9e345b"
|
||||
|
Loading…
Reference in New Issue
Block a user