deno.land / x / masx200_leetcode_test@10.6.5 / reformat-date / index.ts

نووسراو ببینە
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
export 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,};
masx200_leetcode_test

Version Info

Tagged at
a year ago