Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
frontend
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
vicotor
frontend
Commits
30001725
Commit
30001725
authored
Sep 27, 2022
by
tom
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
relative time configuration
parent
150c98f4
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
1 deletion
+36
-1
dayjs.ts
lib/date/dayjs.ts
+36
-1
No files found.
lib/date/dayjs.ts
View file @
30001725
// eslint-disable-next-line no-restricted-imports
// eslint-disable-next-line no-restricted-imports
import
dayjs
from
'
dayjs
'
;
import
dayjs
from
'
dayjs
'
;
import
duration
from
'
dayjs/plugin/duration
'
;
import
localizedFormat
from
'
dayjs/plugin/localizedFormat
'
;
import
localizedFormat
from
'
dayjs/plugin/localizedFormat
'
;
import
relativeTime
from
'
dayjs/plugin/relativeTime
'
;
import
relativeTime
from
'
dayjs/plugin/relativeTime
'
;
import
updateLocale
from
'
dayjs/plugin/updateLocale
'
;
import
updateLocale
from
'
dayjs/plugin/updateLocale
'
;
dayjs
.
locale
(
'
en
'
);
dayjs
.
locale
(
'
en
'
);
dayjs
.
extend
(
relativeTime
);
const
relativeTimeConfig
=
{
thresholds
:
[
{
l
:
'
s
'
,
r
:
1
},
{
l
:
'
ss
'
,
r
:
59
,
d
:
'
second
'
},
{
l
:
'
m
'
,
r
:
1
},
{
l
:
'
mm
'
,
r
:
59
,
d
:
'
minute
'
},
{
l
:
'
h
'
,
r
:
1
},
{
l
:
'
hh
'
,
r
:
23
,
d
:
'
hour
'
},
{
l
:
'
d
'
,
r
:
1
},
{
l
:
'
dd
'
,
r
:
29
,
d
:
'
day
'
},
{
l
:
'
M
'
,
r
:
1
},
{
l
:
'
MM
'
,
r
:
11
,
d
:
'
month
'
},
{
l
:
'
y
'
},
{
l
:
'
yy
'
,
d
:
'
year
'
},
],
};
dayjs
.
extend
(
relativeTime
,
relativeTimeConfig
);
dayjs
.
extend
(
updateLocale
);
dayjs
.
extend
(
updateLocale
);
dayjs
.
extend
(
localizedFormat
);
dayjs
.
extend
(
localizedFormat
);
dayjs
.
extend
(
duration
);
dayjs
.
updateLocale
(
'
en
'
,
{
dayjs
.
updateLocale
(
'
en
'
,
{
formats
:
{
formats
:
{
LLLL
:
'
MMMM-DD-YYYY HH:mm:ss A Z UTC
'
,
LLLL
:
'
MMMM-DD-YYYY HH:mm:ss A Z UTC
'
,
},
},
relativeTime
:
{
s
:
'
a sec
'
,
ss
:
'
%d secs
'
,
future
:
'
in %s
'
,
past
:
'
%s ago
'
,
m
:
'
a min
'
,
mm
:
'
%d mins
'
,
h
:
'
an hour
'
,
hh
:
'
%d hours
'
,
d
:
'
a day
'
,
dd
:
'
%d days
'
,
M
:
'
a month
'
,
MM
:
'
%d months
'
,
y
:
'
a year
'
,
yy
:
'
%d years
'
,
},
});
});
export
default
dayjs
;
export
default
dayjs
;
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment