9 lines
246 B
JavaScript
9 lines
246 B
JavaScript
export default class util {
|
|
static formatTime(str) {
|
|
const match = str.match(/-(\d+:\d+):\d+.*(am|pm)/i);
|
|
if (!match) return null;
|
|
|
|
const [_, hourMin, ampm] = match;
|
|
return hourMin + ampm.toLowerCase();
|
|
}
|
|
} |