1
0
Fork 0

Fix glitch in custom start date/time persistence

This commit is contained in:
James Turner 2018-07-18 15:37:32 +01:00
parent 3422caa4d2
commit af380e0d8c

View file

@ -33,7 +33,8 @@ SettingControl {
function restoreState()
{
var rawValue = _config.getValueForKey("", root.setting, defaultValue);
if (rawValue.getFullYear() < 1800) {
var year = rawValue.getFullYear();
if (isNaN(year) || (year < 1800)) {
// assume it's an invalid date, there doesn't seem to be a better
// way to check date validity from JS :(
rawValue = defaultValue