Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
thecybernanny-webapp
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
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
asranov0003
thecybernanny-webapp
Commits
7ae3818b
Commit
7ae3818b
authored
Jul 04, 2025
by
asranov0003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: add format to ddmmyyyy util function
parent
82c42cf8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
1 deletion
+13
-1
Header.tsx
src/layouts/Header/Header.tsx
+4
-1
utils.ts
src/utils/utils.ts
+9
-0
No files found.
src/layouts/Header/Header.tsx
View file @
7ae3818b
...
...
@@ -20,6 +20,7 @@ import {
}
from
"../../stores/store"
;
import
{
accountSession
}
from
"../../stores/slices/accountSlice"
;
import
{
FaUserAlt
}
from
"react-icons/fa"
;
import
{
formatToDDMMYYYY
}
from
"../../utils/utils"
;
const
devices
=
[
{
...
...
@@ -106,7 +107,9 @@ const Header: React.FC = () => {
<
p
>
{
t
(
"session.activeTill"
)
}
:
{
" "
}
{
session
.
subDateEnd
?
(
<
span
className=
"text-success"
>
{
session
.
subDateEnd
}
</
span
>
<
span
className=
"text-success"
>
{
formatToDDMMYYYY
(
session
.
subDateEnd
)
}
</
span
>
)
:
(
<
span
className=
"text-danger"
>
{
t
(
"session.noSubscription"
)
}
...
...
src/utils/utils.ts
View file @
7ae3818b
...
...
@@ -19,3 +19,12 @@ export const generateDeviceId = (): string => {
return
id
;
};
export
const
formatToDDMMYYYY
=
(
dateString
:
string
)
=>
{
const
date
=
new
Date
(
dateString
);
const
day
=
String
(
date
.
getDate
()).
padStart
(
2
,
"0"
);
const
month
=
String
(
date
.
getMonth
()
+
1
).
padStart
(
2
,
"0"
);
const
year
=
date
.
getFullYear
();
return
`
${
day
}
/
${
month
}
/
${
year
}
`
;
};
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