summaryrefslogtreecommitdiff
path: root/www/js/utils.js
diff options
context:
space:
mode:
authorChristian Pointner <equinox@helsinki.at>2017-01-14 04:31:59 (GMT)
committerChristian Pointner <equinox@helsinki.at>2017-01-14 04:31:59 (GMT)
commit0cc67d030dd5fc8b5a853dfd4d8d8ea6a7c85806 (patch)
tree9fb1a518a070874cbaea75ecf1cfabdb9e213e5b /www/js/utils.js
parentdeaa31e2269b4f13ddf777a4c05a57dc26d7bba1 (diff)
added date controller
Diffstat (limited to 'www/js/utils.js')
-rw-r--r--www/js/utils.js10
1 files changed, 10 insertions, 0 deletions
diff --git a/www/js/utils.js b/www/js/utils.js
index ad64c17..ae2ad0a 100644
--- a/www/js/utils.js
+++ b/www/js/utils.js
@@ -54,6 +54,16 @@ monthname[11] = 'Dezember';
var monthname_short = new Array('Jan', 'Feb', 'Mär', 'Apr', 'Mai', 'Jun', 'Jul', 'Aug', 'Sep', 'Okt', 'Nov', 'Dez');
+function format_date_iso(d) {
+ if(Object.prototype.toString.call(d) !== '[object Date]') {
+ return '-';
+ }
+ if (d.toString() === 'Invalid Date') {
+ return '-';
+ }
+ return d.getFullYear() + '-' + Number(d.getMonth() + 1).pad(2) + '-' + Number(d.getDate()).pad(2);
+}
+
function format_date(d) {
if(Object.prototype.toString.call(d) !== '[object Date]') {
return '-';