🚸 Include seconds in upload date

See #3174
This commit is contained in:
Gina Häußge committed 2019-05-21 15:18:24 +02:00
1 parent d40c3e6241
commit c8ea808d93
2 files changed
+13 -3

No files matched your search

+12 -2
View File
@@ -576,9 +576,19 @@ function formatFuzzyPrintTime(totalSeconds) {
return _.sprintf(text, replacements);
}
function formatDate(unixTimestamp) {
function formatDate(unixTimestamp, options) {
if (!options) {
options = { seconds: false };
}
if (!unixTimestamp) return "-";
return moment.unix(unixTimestamp).format(gettext(/* L10N: Date format */ "YYYY-MM-DD HH:mm"));
var format = gettext(/* L10N: Date format */ "YYYY-MM-DD HH:mm");
if (options.seconds) {
format = gettext(/* L10N: Date format with seconds */ "YYYY-MM-DD HH:mm:ss");
}
return moment.unix(unixTimestamp).format(format);
}
function formatTimeAgo(unixTimestamp) {
@@ -201,7 +201,7 @@ $(function() {
return "";
}
return formatDate(date);
return formatDate(date, {seconds:true});
});
self.fromCurrentData = function(data) {