From 377da9349e57c7b3efb4b1fad70d3bcac341d475 Mon Sep 17 00:00:00 2001 From: Tim Schaub Date: Sat, 14 Sep 2013 13:00:55 -0600 Subject: [PATCH] Don't use private `date_` property (see #1026) It looks like at some point the Closure Library exposed a public `date` property for this same purpose. The version of the Closure Library that comes with the closure-util package uses this property. At some point later, I'll demonstrate how we can control which version of the library we depend on. --- src/ol/parser/kmlparser.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/ol/parser/kmlparser.js b/src/ol/parser/kmlparser.js index b726f9b5fc..8a27805038 100644 --- a/src/ol/parser/kmlparser.js +++ b/src/ol/parser/kmlparser.js @@ -318,7 +318,16 @@ ol.parser.KML = function(opt_options) { value += ':00'; } } - container.whens.push(goog.date.fromIsoString(value).date_); + var date = goog.date.fromIsoString(value); + if (!goog.isNull(date)) { + /** + * Older Closure Library did not provide a date property on + * goog.date.DateTime. When we get rid of Plovr, this can be + * simplified to use the date property. + */ + date = new Date(date.getTime()); + } + container.whens.push(date); }, '_trackPointAttribute': function(node, container) { var name = node.nodeName.split(':').pop();