局部地更改语言环境
当传递可能需要格式化为不同区域设置的日期时间时,全局区域设置配置可能会出现问题。
¥A global locale configuration can be problematic when passing around date-times that may need to be formatted into different locale.
与 dayjs#locale
完全相同,但仅在特定实例中使用区域设置,并通过切换到新区域设置返回新实例。
¥Exactly the same as dayjs#locale
, but only use locale in a specific instance and returns a new instance by switching to new locale.
require('dayjs/locale/de')
dayjs().locale('de').format() // use loaded locale locally