diff --git a/Library/0BDFDB.plugin.js b/Library/0BDFDB.plugin.js index c0019c8739..a8d9b1e752 100644 --- a/Library/0BDFDB.plugin.js +++ b/Library/0BDFDB.plugin.js @@ -2,7 +2,7 @@ * @name BDFDB * @author DevilBro * @authorId 278543574059057154 - * @version 1.7.12 + * @version 1.7.13 * @description Required Library for DevilBro's Plugins * @invite Jx3TjNS * @donate https://www.paypal.me/MircoWittrien @@ -19,10 +19,15 @@ module.exports = (_ => { "info": { "name": "BDFDB", "author": "DevilBro", - "version": "1.7.12", + "version": "1.7.13", "description": "Required Library for DevilBro's Plugins" }, - "rawUrl": `https://mwittrien.github.io/BetterDiscordAddons/Library/0BDFDB.plugin.js` + "rawUrl": `https://mwittrien.github.io/BetterDiscordAddons/Library/0BDFDB.plugin.js`, + "changeLog": { + "fixed": { + "Date Formatter": "No longer shows future dates as 'today'" + } + } }; const DiscordObjects = {}; @@ -5882,9 +5887,10 @@ module.exports = (_ => { .replace(/\$month/g, timeObj.toLocaleDateString(language, {month: "long"})) .replace(/\$dayS/g, timeObj.toLocaleDateString(language, {weekday: "short"})) .replace(/\$day/g, timeObj.toLocaleDateString(language, {weekday: "long"})) - .replace(/\$agoAmount/g, daysAgo > 1 ? BDFDB.LanguageUtils.LanguageStringsFormat(`GAME_LIBRARY_LAST_PLAYED_${daysAgo > 80 ? "MONTHS" : daysAgo > 30 ? "WEEKS" : "DAYS"}`, daysAgo > 80 ? Math.round(daysAgo/30) : daysAgo > 30 ? Math.round(daysAgo/7) : daysAgo) : BDFDB.LanguageUtils.LanguageStrings[`SEARCH_SHORTCUT_${daysAgo == 1 ? "YESTERDAY" : "TODAY"}`]) - .replace(/\$agoDays/g, daysAgo > 1 ? BDFDB.LanguageUtils.LanguageStringsFormat(`GAME_LIBRARY_LAST_PLAYED_DAYS`, daysAgo) : BDFDB.LanguageUtils.LanguageStrings[`SEARCH_SHORTCUT_${daysAgo == 1 ? "YESTERDAY" : "TODAY"}`]) - .replace(/\$agoDate/g, daysAgo > 1 ? date : BDFDB.LanguageUtils.LanguageStrings[`SEARCH_SHORTCUT_${daysAgo == 1 ? "YESTERDAY" : "TODAY"}`]); + .replace(/\$agoAmount/g, daysAgo < 0 ? "" : daysAgo > 1 ? BDFDB.LanguageUtils.LanguageStringsFormat(`GAME_LIBRARY_LAST_PLAYED_${daysAgo > 80 ? "MONTHS" : daysAgo > 30 ? "WEEKS" : "DAYS"}`, daysAgo > 80 ? Math.round(daysAgo/30) : daysAgo > 30 ? Math.round(daysAgo/7) : daysAgo) : BDFDB.LanguageUtils.LanguageStrings[`SEARCH_SHORTCUT_${daysAgo == 1 ? "YESTERDAY" : "TODAY"}`]) + .replace(/\$agoDays/g, daysAgo < 0 ? "" : daysAgo > 1 ? BDFDB.LanguageUtils.LanguageStringsFormat(`GAME_LIBRARY_LAST_PLAYED_DAYS`, daysAgo) : BDFDB.LanguageUtils.LanguageStrings[`SEARCH_SHORTCUT_${daysAgo == 1 ? "YESTERDAY" : "TODAY"}`]) + .replace(/\$agoDate/g, daysAgo < 0 ? "" : daysAgo > 1 ? date : BDFDB.LanguageUtils.LanguageStrings[`SEARCH_SHORTCUT_${daysAgo == 1 ? "YESTERDAY" : "TODAY"}`]) + .replace(/\(\)|\[\]/g, "").replace(/,\s*$|^\s*,/g, "").replace(/ +/g, " ").trim(); }; InternalComponents.LibraryComponents.DateInput.formatDate = function (data, time) { if (typeof data == "string") data = {dateString: data}; @@ -5902,7 +5908,8 @@ module.exports = (_ => { .replace(/\$mm/g, timeObj.toLocaleDateString(language, {month: "2-digit"})) .replace(/\$m/g, timeObj.toLocaleDateString(language, {month: "numeric"})) .replace(/\$yyyy/g, timeObj.toLocaleDateString(language, {year: "numeric"})) - .replace(/\$yy/g, timeObj.toLocaleDateString(language, {year: "2-digit"})); + .replace(/\$yy/g, timeObj.toLocaleDateString(language, {year: "2-digit"})) + .trim(); }; InternalComponents.LibraryComponents.DateInput.formatTime = function (data, time, hour12) { if (typeof data == "string") data = {timeString: data}; @@ -5929,7 +5936,8 @@ module.exports = (_ => { .replace(/\$ss/g, seconds < 10 ? `0${seconds}` : seconds) .replace(/\$s/g, seconds) .replace(/\$uu/g, milli < 10 ? `00${seconds}` : milli < 100 ? `0${milli}` : milli) - .replace(/\$u/g, milli); + .replace(/\$u/g, milli) + .trim(); let digits = "\\d"; if (BDFDB.LanguageUtils.languages[language] && BDFDB.LanguageUtils.languages[language].numberMap) { diff --git a/Library/_res/BDFDB.data.json b/Library/_res/BDFDB.data.json index 222d217de4..9908edd31c 100644 --- a/Library/_res/BDFDB.data.json +++ b/Library/_res/BDFDB.data.json @@ -1148,7 +1148,7 @@ "AuditLogPopout": {"props": ["guildSettingsAuditLogsUserFilterPopout"]}, "AuthBox": {"props": ["authBox"]}, "Autocomplete": {"props": ["autocomplete", "autocompleteRow"]}, - "AutocompleteAliases": {"props": ["autocompleteLayer", "stickerAutoComplete"]}, + "AutocompleteAliases": {"props": ["autocomplete", "stickerAutoComplete"]}, "Avatar": {"props": ["avatar", "mask", "wrapper"]}, "AvatarIcon": {"props": ["iconActiveLarge", "iconActiveMedium"]}, "Backdrop": {"props": ["backdrop", "withLayer"]},