diff --git a/filterObjectUtils.js b/filterObjectUtils.js index 9b98bef..95dc422 100644 --- a/filterObjectUtils.js +++ b/filterObjectUtils.js @@ -8,20 +8,28 @@ var config = require('./config'); // and format date and datetime strings. var DATETIME_FORMATS = { full: 'YYYY-MM-DD HH:mm:ss', + fullWithT: 'YYYY-MM-DDTHH:mm:ss', date: 'YYYY-MM-DD', time: 'HH:mm:ss' }; +// We always want to use strict mode for our date parsing. Defining a boolean +// constant makes the moment constructor calls more self documenting. +var STRICT = true; + // `isDateString` returns a boolean indicating whether or not the string value // should be treated as datetime. function isDateTimeString(value) { - return moment(value, DATETIME_FORMATS.full).isValid(); + return moment(value, DATETIME_FORMATS.full, STRICT).isValid() || + moment(value, DATETIME_FORMATS.fullWithT, STRICT).isValid(); } // `dateTimeStringToSqlValue` converts a datetime string into a Postgres // compatible literal date and time value. function dateTimeStringToSqlValue(dtString) { - var m = moment(dtString, DATETIME_FORMATS.full); + var m = moment(dtString, DATETIME_FORMATS.full, STRICT).isValid() ? + moment(dtString, DATETIME_FORMATS.full, STRICT) : + moment(dtString, DATETIME_FORMATS.fullWithT, STRICT); return "(DATE '" + m.format(DATETIME_FORMATS.date) + "' + TIME '" + m.format(DATETIME_FORMATS.time) + "')"; } diff --git a/package.json b/package.json index 5b8370c..361aa70 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,7 @@ }, "dependencies": { "express": "3.21.2", - "moment": "2.1.0", + "moment": "2.19.3", "rollbar": "^2.2.7", "underscore": "^1.8.3", "windshaft": "^3.3.1" diff --git a/style/mapFeature.mms b/style/mapFeature.mms index 27e9ede..f4685e9 100644 --- a/style/mapFeature.mms +++ b/style/mapFeature.mms @@ -1,12 +1,15 @@ // If any changes are made to this stylesheet, make sure those // changes are replicated in uncoloredMapFeature.mms (if necessary) -@tree_fill_color: #8BAA3D; -@empty_plot_fill_color: #BCA371; +@tree_fill_color: #8BAA3C; +@tree_stroke_color: #A5BF5B; + +@empty_plot_fill_color: #E1C6FF; +@empty_plot_stroke_color: #D4B5F9; + @gsi_fill_color: #388E8E; @tree_gsi_border_color: #b6ce78; -@empty_plot_border_color: #D3C3A5; #treemap_mapfeature { [tree_id!=null][feature_type="Plot"] { @@ -22,9 +25,11 @@ marker-allow-overlap: true; - + [tree_id!=null][feature_type="Plot"][zoom >= 15] { + marker-line-color: @tree_stroke_color; + } [tree_id=null][feature_type="Plot"][zoom >= 15] { - marker-line-color: @empty_plot_border_color; + marker-line-color: @empty_plot_stroke_color; } [tree_id!=null][feature_type="Plot"][zoom >= 15] { marker-line-color: @tree_gsi_border_color; diff --git a/yarn.lock b/yarn.lock index c7b3f40..a189141 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1498,9 +1498,9 @@ mocha@^3.5.2: mkdirp "0.5.1" supports-color "3.1.2" -moment@2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/moment/-/moment-2.1.0.tgz#1fd7b1134029a953c6ea371dbaee37598ac03567" +moment@2.19.3: + version "2.19.3" + resolved "https://registry.yarnpkg.com/moment/-/moment-2.19.3.tgz#bdb99d270d6d7fda78cc0fbace855e27fe7da69f" morgan@~1.6.1: version "1.6.1"