UNPKG

@jahed/sparql-engine

Version:

SPARQL query engine for servers and web browsers.

18 lines 544 B
// SPDX-License-Identifier: MIT export function parseISO8601(dateString) { const matches = /(\d\d\d\d)-?(\d\d)-?(\d\d)T(\d\d):?(\d\d):?(\d\d(?:\.\d+)?)(Z|(?:[+-].*))?$/.exec(dateString); if (matches) { const [, year, month, day, hour, minute, second, timezone = ""] = matches; return { year, month, day, hour, minute, second, timezone, }; } throw new Error("Invalid ISO 8601 string."); } //# sourceMappingURL=date.js.map