UNPKG

@atlaskit/profilecard

Version:

A React component to display a card with user information.

20 lines 656 B
function padMinutes(minutes) { return minutes < 10 ? "0".concat(minutes) : String(minutes); } export var random = function random(int) { return Math.floor(Math.random() * (int + 1)); }; export var getWeekday = function getWeekday() { var array = ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']; var index = random(6); return { index: index, string: array[index] }; }; export var 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); };