[New] Added formatDateDashIfEmpty()

This commit is contained in:
Robert von Burg 2022-06-22 08:47:35 +02:00
parent 11e0dcfe67
commit 61768b5cad
Signed by: eitch
GPG Key ID: 75DB9C85C74331F7
2 changed files with 9 additions and 1 deletions

View File

@ -1,7 +1,7 @@
{
"name": "strolch-wc-util-behavior",
"description": "Strolch Polymer Util Behaviors",
"version": "0.3.5",
"version": "0.3.6",
"authors": [
"Robert von Burg"
],

View File

@ -302,6 +302,14 @@
formatDateTime: function (string) {
return Strolch.toLocalDateTime(string);
},
formatDateDashIfEmpty: function (string) {
if (string == null || string === "" || string === "-" || string === "1970-01-01T01:00:00+01:00")
return "-";
return Strolch.toLocalDate(string);
},
formatDate: function (string) {
return Strolch.toLocalDate(string);
},
parsePeriodUnit: function (p) {
// P3M -> months