Merge branch 'master-dayjs'
This commit is contained in:
commit
11f18a1b19
4 changed files with 99 additions and 0 deletions
29
src/dayjs.ts
Executable file
29
src/dayjs.ts
Executable file
|
|
@ -0,0 +1,29 @@
|
|||
import type dayjs from "dayjs"
|
||||
import type { Dayjs } from "dayjs"
|
||||
|
||||
export type { ManipulateType } from "dayjs"
|
||||
|
||||
import duration from "dayjs/plugin/duration"
|
||||
import isSameOrAfter from "dayjs/plugin/isSameOrAfter"
|
||||
import isSameOrBefore from "dayjs/plugin/isSameOrBefore"
|
||||
import minMax from "dayjs/plugin/minMax"
|
||||
import relativeTime from "dayjs/plugin/relativeTime"
|
||||
import timezone from "dayjs/plugin/timezone"
|
||||
import utc from "dayjs/plugin/utc"
|
||||
import weekOfYear from "dayjs/plugin/weekOfYear"
|
||||
import "dayjs/locale/pt-br"
|
||||
|
||||
export const definirDayjsbr = (dayjsEntrada: typeof dayjs) => {
|
||||
dayjsEntrada.locale("pt-br")
|
||||
dayjsEntrada.extend(utc)
|
||||
dayjsEntrada.extend(timezone)
|
||||
dayjsEntrada.extend(weekOfYear)
|
||||
dayjsEntrada.extend(isSameOrBefore)
|
||||
dayjsEntrada.extend(isSameOrAfter)
|
||||
dayjsEntrada.extend(minMax)
|
||||
dayjsEntrada.extend(relativeTime)
|
||||
dayjsEntrada.extend(duration)
|
||||
return dayjsEntrada
|
||||
}
|
||||
|
||||
export type { Dayjs }
|
||||
Loading…
Add table
Add a link
Reference in a new issue