Хотфикс

This commit is contained in:
JonnyBro 2022-11-15 20:37:03 +05:00
parent 542a4e6f8b
commit ed649e4788

View file

@ -260,7 +260,7 @@ class JaBa extends Client {
* @returns {String} Beautified date * @returns {String} Beautified date
*/ */
printDate(date, format = "", locale = this.defaultLanguage) { printDate(date, format = "", locale = this.defaultLanguage) {
const languageData = this.languages.find(language => language.name === locale || language.aliases.includes(locale)); const languageData = this.languages.find(language => language.name === locale);
if (format === "" || format === null) format = languageData.defaultMomentFormat; if (format === "" || format === null) format = languageData.defaultMomentFormat;
return moment(new Date(date)) return moment(new Date(date))
@ -277,7 +277,7 @@ class JaBa extends Client {
* @returns {String} Time * @returns {String} Time
*/ */
convertTime(time, type = false, noPrefix = false, locale = this.defaultLanguage) { convertTime(time, type = false, noPrefix = false, locale = this.defaultLanguage) {
const languageData = this.languages.find(language => language.name === locale || language.aliases.includes(locale)); const languageData = this.languages.find(language => language.name === locale);
const m = moment(time).locale(languageData.moment); const m = moment(time).locale(languageData.moment);
return (type ? m.toNow(noPrefix) : m.fromNow(noPrefix)); return (type ? m.toNow(noPrefix) : m.fromNow(noPrefix));