Remove padding from date strings
The padding is removed by using %-d instead of %e or %d. Examples: "%B %d %Y" -> "October 04 2018" "%B %e %Y" -> "October 4 2018" "%B %-d %Y" -> "October 4 2018" https://gitlab.gnome.org/GNOME/gnome-shell/issues/666
This commit is contained in:

committed by
Florian Müllner

parent
cff9eaf5aa
commit
0f542c2e16
@ -243,13 +243,13 @@ function formatTime(time, params) {
|
||||
followed by a time string in 24h format.
|
||||
i.e. "May 25, 14:30" */
|
||||
// xgettext:no-c-format
|
||||
format = N_("%B %d, %H\u2236%M");
|
||||
format = N_("%B %-d, %H\u2236%M");
|
||||
else
|
||||
/* Translators: this is the month name, day number, year
|
||||
number followed by a time string in 24h format.
|
||||
i.e. "May 25 2012, 14:30" */
|
||||
// xgettext:no-c-format
|
||||
format = N_("%B %d %Y, %H\u2236%M");
|
||||
format = N_("%B %-d %Y, %H\u2236%M");
|
||||
} else {
|
||||
// Show only the time if date is on today
|
||||
if (daysAgo < 1 || params.timeOnly)
|
||||
@ -272,13 +272,13 @@ function formatTime(time, params) {
|
||||
followed by a time string in 12h format.
|
||||
i.e. "May 25, 2:30 pm" */
|
||||
// xgettext:no-c-format
|
||||
format = N_("%B %d, %l\u2236%M %p");
|
||||
format = N_("%B %-d, %l\u2236%M %p");
|
||||
else
|
||||
/* Translators: this is the month name, day number, year
|
||||
number followed by a time string in 12h format.
|
||||
i.e. "May 25 2012, 2:30 pm"*/
|
||||
// xgettext:no-c-format
|
||||
format = N_("%B %d %Y, %l\u2236%M %p");
|
||||
format = N_("%B %-d %Y, %l\u2236%M %p");
|
||||
}
|
||||
|
||||
let formattedTime = date.format(Shell.util_translate_time_string(format));
|
||||
|
Reference in New Issue
Block a user