deno.land / x / masx200_leetcode_test@10.6.5 / reformat-date / index.ts
1234567891011121314151617181920212223242526export default function reformatDate(date: string): string { const [day, month, year] = date.split(" ");
return ( year + "-" + String(months_transform[month]).padStart(2, "0") + "-" + String(parseInt(day)).padStart(2, "0") );}const months_transform: Record<string, number> = { Jan: 1, Feb: 2, Mar: 3, Apr: 4, May: 5, Jun: 6, Jul: 7, Aug: 8, Sep: 9, Oct: 10, Nov: 11, Dec: 12,};
Version Info