@telerik/kendo-intl
Advanced tools
Comparing version 1.2.2-dev.201709141443 to 1.3.0-dev.201710031120
@@ -20,2 +20,4 @@ var MONTH = 'month'; | ||
'H': HOUR, | ||
'k': HOUR, | ||
'K': HOUR, | ||
'm': 'minute', | ||
@@ -30,5 +32,5 @@ 's': 'second', | ||
var dateFormatRegExp = /d{1,2}|E{1,6}|e{1,6}|c{3,6}|c{1}|M{1,5}|L{1,5}|y{1,4}|H{1,2}|h{1,2}|m{1,2}|a{1,5}|s{1,2}|S{1,3}|z{1,4}|Z{1,5}|x{1,5}|X{1,5}|G{1,5}|q{1,5}|Q{1,5}|"[^"]*"|'[^']*'/g; | ||
var dateFormatRegExp = /d{1,2}|E{1,6}|e{1,6}|c{3,6}|c{1}|M{1,5}|L{1,5}|y{1,4}|H{1,2}|h{1,2}|k{1,2}|K{1,2}|m{1,2}|a{1,5}|s{1,2}|S{1,3}|z{1,4}|Z{1,5}|x{1,5}|X{1,5}|G{1,5}|q{1,5}|Q{1,5}|"[^"]*"|'[^']*'/g; | ||
export { dateFormatRegExp, DATE_FIELD_MAP }; | ||
//# sourceMappingURL=constants.js.map |
@@ -110,2 +110,10 @@ import { localeInfo, firstDay } from '../cldr'; | ||
formatters.k = function(date, formatLength) { | ||
return pad(date.getHours() || 24, formatLength); | ||
}; | ||
formatters.K = function(date, formatLength) { | ||
return pad(date.getHours() % 12, formatLength); | ||
}; | ||
formatters.m = function(date, formatLength) { | ||
@@ -112,0 +120,0 @@ return pad(date.getMinutes(), formatLength); |
@@ -257,2 +257,14 @@ import { adjustDST, convertTimeZone } from './time-utils'; | ||
parsers.K = function(state) { | ||
lookAhead("K", state); | ||
var hours = getNumber(2, state); | ||
if (hours === null || outOfRange(hours, 0, 11)) { | ||
return true; | ||
} | ||
state.hours = hours; | ||
}; | ||
parsers.a = function(state, info) { | ||
@@ -262,3 +274,3 @@ var count = lookAhead("a", state); | ||
var pmHour = getIndexByName([ periodFormats.pm ], state,true); | ||
var pmHour = getIndexByName([ periodFormats.pm ], state, true); | ||
if (!pmHour && !getIndexByName([ periodFormats.am ], state, true)) { | ||
@@ -280,2 +292,14 @@ return true; | ||
parsers.k = function(state) { | ||
lookAhead("k", state); | ||
var hours = getNumber(2, state); | ||
if (hours === null || outOfRange(hours, 1, 24)) { | ||
return true; | ||
} | ||
state.hours = hours === 24 ? 0 : hours; | ||
}; | ||
parsers.m = function(state) { | ||
@@ -282,0 +306,0 @@ lookAhead("m", state); |
@@ -57,3 +57,3 @@ import { DEFAULT_LOCALE } from '../common/constants'; | ||
function isHour12(pattern) { | ||
return pattern === 'h'; | ||
return pattern === 'h' || pattern === 'K'; | ||
} | ||
@@ -60,0 +60,0 @@ |
@@ -16,3 +16,3 @@ import { localeInfo } from '../cldr'; | ||
if (!isFinite(number)) { | ||
return number; | ||
return String(number); | ||
} | ||
@@ -19,0 +19,0 @@ |
{ | ||
"name": "@telerik/kendo-intl", | ||
"description": "A package exporting functions for date and number parsing and formatting", | ||
"version": "1.2.2-dev.201709141443", | ||
"version": "1.3.0-dev.201710031120", | ||
"repository": { | ||
@@ -6,0 +6,0 @@ "type": "git", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
655797
102
6081