From 6f90977196f13f7edc10cfe4c681bf4e96170374 Mon Sep 17 00:00:00 2001 From: Francis Lachapelle Date: Tue, 2 Mar 2021 14:59:59 -0500 Subject: [PATCH] fix(common(js)): improve parsing of year There's no perfect solution when only two digits are used for the year. It's always better to show four digits for the year to avoid unexpected results. Fixes #5268 --- UI/WebServerResources/js/Common/utils.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/UI/WebServerResources/js/Common/utils.js b/UI/WebServerResources/js/Common/utils.js index 7273a22fa..70ade85d3 100644 --- a/UI/WebServerResources/js/Common/utils.js +++ b/UI/WebServerResources/js/Common/utils.js @@ -210,7 +210,7 @@ String.prototype.parseDate = function(localeProvider, format) { return (i >= 0); }], '%y': [/\d\d/, function(input) { - var nearFuture = parseInt(now.getFullYear().toString().substring(2)) + 5; + var nearFuture = parseInt(now.getFullYear().toString().substring(2)) + 50; date.year = parseInt(input); if (date.year < nearFuture) date.year += 2000; else date.year += 1900;