forked from Shinonome/dots-hyprland
user config: add date format #307
This commit is contained in:
@@ -222,7 +222,7 @@ export default ({
|
|||||||
else if (messageTime.get_day_of_year() == GLib.DateTime.new_now_local().get_day_of_year() - 1)
|
else if (messageTime.get_day_of_year() == GLib.DateTime.new_now_local().get_day_of_year() - 1)
|
||||||
notifTime = 'Yesterday';
|
notifTime = 'Yesterday';
|
||||||
else
|
else
|
||||||
notifTime = messageTime.format('%d/%m');
|
notifTime = messageTime.format(userOptions.time.dateFormat);
|
||||||
const notifTextSummary = Label({
|
const notifTextSummary = Label({
|
||||||
xalign: 0,
|
xalign: 0,
|
||||||
className: 'txt-small txt-semibold titlefont',
|
className: 'txt-small txt-semibold titlefont',
|
||||||
|
|||||||
@@ -45,9 +45,9 @@ const BarClock = () => Widget.Box({
|
|||||||
}),
|
}),
|
||||||
Widget.Label({
|
Widget.Label({
|
||||||
className: 'txt-smallie',
|
className: 'txt-smallie',
|
||||||
label: GLib.DateTime.new_now_local().format("%A, %d/%m"),
|
label: GLib.DateTime.new_now_local().format(userOptions.time.dateFormatLong),
|
||||||
setup: (self) => self.poll(5000, label => {
|
setup: (self) => self.poll(userOptions.time.dateInterval, (label) => {
|
||||||
label.label = GLib.DateTime.new_now_local().format("%A, %d/%m");
|
label.label = GLib.DateTime.new_now_local().format(userOptions.time.dateFormatLong);
|
||||||
}),
|
}),
|
||||||
}),
|
}),
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -25,9 +25,9 @@ const TimeAndDate = () => Box({
|
|||||||
Label({
|
Label({
|
||||||
className: 'bg-time-date',
|
className: 'bg-time-date',
|
||||||
xalign: 0,
|
xalign: 0,
|
||||||
label: GLib.DateTime.new_now_local().format("%A, %d/%m/%Y"),
|
label: GLib.DateTime.new_now_local().format(userOptions.time.dateFormatLong),
|
||||||
setup: (self) => self.poll(5000, label => {
|
setup: (self) => self.poll(userOptions.time.dateInterval, (label) => {
|
||||||
label.label = GLib.DateTime.new_now_local().format("%A, %d/%m/%Y");
|
label.label = GLib.DateTime.new_now_local().format(userOptions.time.dateFormatLong);
|
||||||
}),
|
}),
|
||||||
}),
|
}),
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -44,6 +44,9 @@ let userConfigOptions = {
|
|||||||
// For seconds, add "%S" and set interval to 1000
|
// For seconds, add "%S" and set interval to 1000
|
||||||
'format': "%H:%M",
|
'format': "%H:%M",
|
||||||
'interval': 5000,
|
'interval': 5000,
|
||||||
|
'dateFormatLong': "%A, %d/%m", // On bar
|
||||||
|
'dateInterval': 5000,
|
||||||
|
'dateFormat': "%d/%m", // On notif time
|
||||||
},
|
},
|
||||||
'weather': {
|
'weather': {
|
||||||
'city': "",
|
'city': "",
|
||||||
|
|||||||
Reference in New Issue
Block a user