nativescript-sdk-utility
Advanced tools
Comparing version 1.0.4 to 1.0.5
{ | ||
"name": "nativescript-sdk-utility", | ||
"version": "1.0.4", | ||
"version": "1.0.5", | ||
"description": "This plugin is a collection of utilities for iOS and Android to simplify your NativeScript apps.", | ||
@@ -5,0 +5,0 @@ "main": "sdk-utility", |
@@ -63,3 +63,8 @@ "use strict"; | ||
} | ||
pattern = this.is24HFormat() ? pattern.replace(/h/g, "H") : pattern.replace(/H/g, "h"); | ||
if (this.is24HFormat()) { | ||
pattern = pattern.replace(/h/g, "H").replace(/a/g, ""); | ||
} | ||
else { | ||
pattern = pattern.replace(/H/g, "h"); | ||
} | ||
var sdf = new java.text.SimpleDateFormat(pattern); | ||
@@ -66,0 +71,0 @@ return sdf.format(date ? new java.util.Date(date.valueOf()) : new java.util.Date()).toString(); |
@@ -29,3 +29,8 @@ "use strict"; | ||
} | ||
pattern = this.is24HFormat() ? pattern.replace(/h/g, "H") : pattern.replace(/H/g, "h"); | ||
if (this.is24HFormat()) { | ||
pattern = pattern.replace(/h/g, "H").replace(/a/g, ""); | ||
} | ||
else { | ||
pattern = pattern.replace(/H/g, "h"); | ||
} | ||
dateFormatter.dateFormat = pattern; | ||
@@ -32,0 +37,0 @@ return dateFormatter.stringFromDate(date ? date : new Date()); |
24768
148