mirror of
https://github.com/JonnyBro/JaBa.git
synced 2024-11-22 05:04:58 +05:00
Хотфикс
This commit is contained in:
parent
542a4e6f8b
commit
ed649e4788
1 changed files with 2 additions and 2 deletions
|
@ -260,7 +260,7 @@ class JaBa extends Client {
|
|||
* @returns {String} Beautified date
|
||||
*/
|
||||
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;
|
||||
|
||||
return moment(new Date(date))
|
||||
|
@ -277,7 +277,7 @@ class JaBa extends Client {
|
|||
* @returns {String} Time
|
||||
*/
|
||||
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);
|
||||
|
||||
return (type ? m.toNow(noPrefix) : m.fromNow(noPrefix));
|
||||
|
|
Loading…
Reference in a new issue