add option to customize date format

This commit is contained in:
hat3ph 2024-04-17 11:04:45 +08:00 committed by GitHub
parent ac6b191237
commit 96e578bd51
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 3 additions and 2 deletions

View File

@ -229,7 +229,7 @@ Rectangle {
id: date
anchors.horizontalCenter: parent.horizontalCenter
color: clock.color
text : Qt.formatDate(clock.dateTime, Qt.DefaultLocaleLongDate)
text : Qt.formatDate(clock.dateTime, config.dateFormat || "dddd, dd MMMM yyyy")
font.family: textFont.name
font.pointSize: config.dateFontSize
}

View File

@ -62,7 +62,7 @@ You can change a few settings in this file
- `bgVidDay` and `bgImgNight` - video day/night playlists
- `displayFont` - font
- `clockFontSize`, `dateFontSize`, `labelFontSize`, `errorMsgFontSize` and `languageBoxFontSize` - customize font size
- `timeFormat` - customize time format
- `dateFormat` and `timeFormat` - customize [date and time](https://doc.qt.io/qt-5/qml-qtqml-date.html) format
- `showLoginButton` - if set to false will hide the login button
- `showClearPasswordButton` - if set to false will hide the clear password button that appears when text is inputed
- `passwordLeftMargin` and `usernameLeftMargin` - set margin between input boxes and labels, some fonts are messy and allows fixing of overlap

View File

@ -12,6 +12,7 @@ labelFontSize="16"
errorMsgFontSize="12"
languageBoxFontSize="14"
timeFormat="hh:mm"
dateFormat="dddd, dd MMMM yyyy"
showLoginButton=true
passwordLeftMargin=15
usernameLeftMargin=15