diff --git a/package.json b/package.json index 40b15a3..88ff9ca 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@fleetbase/storefront", - "version": "1.1.2", + "version": "1.1.3", "description": "Fleetbase Storefront JS & Node SDK", "main": "dist/cjs/storefront.js", "module": "dist/esm/storefront.js", diff --git a/src/resources/store-hour.js b/src/resources/store-hour.js index e50b8b0..a9a553c 100644 --- a/src/resources/store-hour.js +++ b/src/resources/store-hour.js @@ -15,10 +15,11 @@ export default class StoreHour extends Resource { return null; } - const includesSeconds = this.getAttribute('start').split(':').length === 3; - const format = includesSeconds ? 'k:mm:ss' : 'k:mm'; + const start = this.getAttribute('start'); + const includesSeconds = start.split(':').length === 3; + const format = includesSeconds ? 'HH:mm:ss' : 'HH:mm'; - return parse(this.getAttribute('start'), format, new Date()); + return parse(start, format, new Date()); } get endDateInstance() { @@ -26,10 +27,11 @@ export default class StoreHour extends Resource { return null; } - const includesSeconds = this.getAttribute('end').split(':').length === 3; - const format = includesSeconds ? 'k:mm:ss' : 'k:mm'; + const end = this.getAttribute('end'); + const includesSeconds = end.split(':').length === 3; + const format = includesSeconds ? 'HH:mm:ss' : 'HH:mm'; - return parse(this.getAttribute('end'), format, new Date()); + return parse(end, format, new Date()); } get humanReadableHours() {