UNPKG

atriusmaps-node-sdk

Version:

This project provides an API to Atrius Personal Wayfinder maps within a Node environment. See the README.md for more information

18 lines (14 loc) 428 B
'use strict'; var luxon = require('luxon'); const formatTime = (datetime, locale = "en") => { if (datetime instanceof Date) { datetime = luxon.DateTime.fromJSDate(datetime); } if (locale === "is") { locale = "ca"; } return datetime.setLocale(locale).toLocaleString(luxon.DateTime.TIME_SIMPLE); }; const msToMin = (ms) => Math.ceil(ms / 60 / 1e3); exports.formatTime = formatTime; exports.msToMin = msToMin;