Named exports from ol/string

This commit is contained in:
Frederic Junod
2018-01-19 15:38:21 +01:00
parent 6385f615c9
commit a114f64429
6 changed files with 64 additions and 66 deletions
+6 -6
View File
@@ -2,7 +2,7 @@
* @module ol/format/XSD
*/
import _ol_xml_ from '../xml.js';
import _ol_string_ from '../string.js';
import {padNumber} from '../string.js';
const XSD = {};
@@ -124,11 +124,11 @@ XSD.writeCDATASection = function(node, string) {
XSD.writeDateTimeTextNode = function(node, dateTime) {
const date = new Date(dateTime * 1000);
const string = date.getUTCFullYear() + '-' +
_ol_string_.padNumber(date.getUTCMonth() + 1, 2) + '-' +
_ol_string_.padNumber(date.getUTCDate(), 2) + 'T' +
_ol_string_.padNumber(date.getUTCHours(), 2) + ':' +
_ol_string_.padNumber(date.getUTCMinutes(), 2) + ':' +
_ol_string_.padNumber(date.getUTCSeconds(), 2) + 'Z';
padNumber(date.getUTCMonth() + 1, 2) + '-' +
padNumber(date.getUTCDate(), 2) + 'T' +
padNumber(date.getUTCHours(), 2) + ':' +
padNumber(date.getUTCMinutes(), 2) + ':' +
padNumber(date.getUTCSeconds(), 2) + 'Z';
node.appendChild(_ol_xml_.DOCUMENT.createTextNode(string));
};