@kotori-bot/i18n
Advanced tools
Comparing version 1.2.0 to 1.2.1
@@ -21,5 +21,5 @@ import LocaleIdentifier from './types/locale'; | ||
extends(lang?: T): I18n<T>; | ||
date(date: Date | number, style?: Intl.DateTimeFormatOptions['dateStyle'], lang?: T): string; | ||
time(time: Date | number, style?: Intl.DateTimeFormatOptions['timeStyle'], lang?: T): string; | ||
period(time: Date | number, style?: Intl.DateTimeFormatOptions['dayPeriod'], lang?: T): string; | ||
date(date?: Date | number, style?: Intl.DateTimeFormatOptions['dateStyle'], lang?: T): string; | ||
time(time?: Date | number, style?: Intl.DateTimeFormatOptions['timeStyle'], lang?: T): string; | ||
period(time?: Date | number, style?: Intl.DateTimeFormatOptions['dayPeriod'], lang?: T): string; | ||
number(number: number, options?: Intl.NumberFormatOptions, lang?: T): string; | ||
@@ -26,0 +26,0 @@ list(list: Iterable<string>, options?: Intl.ListFormatOptions, lang?: T): string; |
@@ -54,9 +54,9 @@ "use strict"; | ||
} | ||
date(date, style, lang = this.lang) { | ||
date(date = new Date(), style = undefined, lang = this.lang) { | ||
return new Intl.DateTimeFormat(locale_1.default[lang], { timeStyle: style }).format(date); | ||
} | ||
time(time, style, lang = this.lang) { | ||
time(time = new Date(), style = undefined, lang = this.lang) { | ||
return new Intl.DateTimeFormat(locale_1.default[lang], { timeStyle: style }).format(time); | ||
} | ||
period(time, style, lang = this.lang) { | ||
period(time = new Date(), style = undefined, lang = this.lang) { | ||
return new Intl.DateTimeFormat(locale_1.default[lang], { dayPeriod: style }).format(time); | ||
@@ -63,0 +63,0 @@ } |
{ | ||
"name": "@kotori-bot/i18n", | ||
"version": "v1.2.0", | ||
"version": "1.2.1", | ||
"description": "i18n For Kotori", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
# @kotori-bot/i18n | ||
这是一个轻量级的国际化(i18n)工具库,可以方便地实现JavaScript/TypeScript项目的本地化支持。 | ||
这是一个轻量级的国际化(i18n)工具库,可以方便地实现 JavaScript/TypeScript 项目的本地化支持。 | ||
@@ -5,0 +5,0 @@ ## 🎯 What |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
47693
0