UNPKG

code-story

Version:

Get your code activity log for standup from git

17 lines (16 loc) 599 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var chrono_node_1 = require("chrono-node"); var pad = function (n) { return (n < 10 ? '0' : '') + n; }; var getFormatedTime = function (dateString) { var Date = chrono_node_1.parseDate(dateString); var year = Date.getFullYear().toString(); var month = pad(Date.getMonth() + 1); var date = pad(Date.getDate()); var hours = pad(Date.getHours()); var minutes = pad(Date.getMinutes()); return hours + ":" + minutes + " " + date + "." + month + "." + year; }; exports.default = getFormatedTime;