apps: updateTime should be null if never updated

"TIMESTAMP NULL" is an attribute modifier to make the column nullable.
Without it, if you assign null, the timestamp becomes the current time!
This commit is contained in:
Girish Ramakrishnan
2024-06-25 16:56:30 +02:00
parent ccd5f6c2e5
commit 6c68f7da2e
4 changed files with 15 additions and 3 deletions
+2
View File
@@ -366,6 +366,8 @@ angular.module('Application').filter('trKeyFromPeriod', function () {
angular.module('Application').filter('prettyDate', function ($translate) {
// http://ejohn.org/files/pretty.js
return function prettyDate(utc) {
if (utc === null) return $translate.instant('main.prettyDate.never', {});
var date = new Date(utc), // this converts utc into browser timezone and not cloudron timezone!
diff = (((new Date()).getTime() - date.getTime()) / 1000) + 30, // add 30seconds for clock skew
day_diff = Math.floor(diff / 86400);