Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
PIM
Itinerary
Commits
7a865827
Commit
7a865827
authored
Dec 03, 2021
by
Kai Uwe Broulik
🍇
Browse files
Show number of days ago the vaccination was
parent
14614ee5
Pipeline
#104961
passed with stage
in 3 minutes and 13 seconds
Changes
1
Pipelines
3
Hide whitespace changes
Inline
Side-by-side
src/app/HealthCertificateVaccination.qml
View file @
7a865827
...
...
@@ -49,9 +49,16 @@ ColumnLayout {
}
QQC2.Label
{
text
:
certificate
.
date
.
toLocaleDateString
(
Qt
.
locale
(),
Locale
.
ShortFormat
)
readonly
property
int
days
:
daysTo
(
certificate
.
date
,
new
Date
())
text
:
{
const
formattedDate
=
certificate
.
date
.
toLocaleDateString
(
Qt
.
locale
(),
Locale
.
ShortFormat
);
if
(
days
>
0
)
{
return
i18np
(
"
%2 (%1 day ago)
"
,
"
%2 (%1 days ago)
"
,
days
,
formattedDate
);
}
return
formattedDate
;
}
Kirigami.FormData.label
:
i18n
(
"
Date:
"
)
color
:
days
To
(
certificate
.
date
,
new
Date
())
>=
14
?
Kirigami
.
Theme
.
positiveTextColor
:
Kirigami
.
Theme
.
neutralTextColor
color
:
days
>=
14
?
Kirigami
.
Theme
.
positiveTextColor
:
Kirigami
.
Theme
.
neutralTextColor
font.bold
:
true
visible
:
!
isNaN
(
certificate
.
date
.
getTime
())
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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