Last active
June 19, 2024 16:03
-
-
Save xardit/2eb9f5584fc7d8045982d6ded68407f0 to your computer and use it in GitHub Desktop.
Revisions
-
xardit revised this gist
Jun 19, 2024 . 1 changed file with 20 additions and 16 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,18 +1,22 @@ const month2sq = { January: 'Janar', February: 'Shkurt', March: 'Mars', April: 'Prill', May: 'Maj', June: 'Qershor', July: 'Korrik', August: 'Gusht', September: 'Shtator', October: 'Tetor', November: 'Nëntor', December: 'Dhjetor', } export function formatDate(date) { let str = new Date(date).toLocaleString('sq', { day: 'numeric', month: 'long', year: 'numeric' }) for (const enMonth in month2sq) { str = str.replace(enMonth, month2sq[enMonth]) } return capitalizeEachWord(str) } -
xardit renamed this gist
Jun 19, 2024 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
xardit created this gist
Jun 19, 2024 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,18 @@ const month2sq = { January: 'Janar', February: 'Shkurt', March: 'Mars', April: 'Prill', May: 'Maj', June: 'Qershor', July: 'Korrik', August: 'Gusht', September: 'Shtator', October: 'Tetor', November: 'Nëntor', December: 'Dhjetor', } const m = new Date().toLocaleString('en', { month: 'long' }) const monthNameSq = isEnglish ? m : month2sq[m]