UNPKG

@atlaskit/profilecard

Version:

A React component to display a card with user information.

26 lines (25 loc) 847 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.random = exports.getWeekday = exports.getTimeString = void 0; function padMinutes(minutes) { return minutes < 10 ? "0".concat(minutes) : String(minutes); } var random = exports.random = function random(int) { return Math.floor(Math.random() * (int + 1)); }; var getWeekday = exports.getWeekday = function getWeekday() { var array = ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']; var index = random(6); return { index: index, string: array[index] }; }; var getTimeString = exports.getTimeString = function getTimeString() { var hours = random(23); var minutes = random(59); var meridiem = ['am', 'pm'][Math.floor(hours / 12)]; return "".concat(hours === 0 ? 12 : hours % 12, ":").concat(padMinutes(minutes)).concat(meridiem); };