Merge branch 'develop'
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
import { Lang } from "@/constants/languages"
|
||||
|
||||
/**
|
||||
* Get the localized month name for a given month index and language
|
||||
* @param monthIndex - The month index (1-12)
|
||||
* @param lang - the language to use, Lang enum
|
||||
* @returns The localized month name
|
||||
*/
|
||||
export function getLocalizedMonthName(monthIndex: number, lang: Lang) {
|
||||
const monthName = new Date(2024, monthIndex - 1).toLocaleString(lang, {
|
||||
month: "long",
|
||||
})
|
||||
|
||||
return monthName.charAt(0).toUpperCase() + monthName.slice(1)
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
import { Lang } from "@/constants/languages"
|
||||
|
||||
/// Function to format numbers with space as thousands separator
|
||||
export function formatNumber(num: number) {
|
||||
// sv hardcoded to force space on thousands
|
||||
const formatter = new Intl.NumberFormat(Lang.sv)
|
||||
return formatter.format(num)
|
||||
}
|
||||
Reference in New Issue
Block a user