This commit is contained in:
Mirco Wittrien 2021-08-02 19:47:10 +02:00
parent 350a8ec5d8
commit 17bec90aff
2 changed files with 17 additions and 9 deletions

View File

@ -2,7 +2,7 @@
* @name BDFDB * @name BDFDB
* @author DevilBro * @author DevilBro
* @authorId 278543574059057154 * @authorId 278543574059057154
* @version 1.7.12 * @version 1.7.13
* @description Required Library for DevilBro's Plugins * @description Required Library for DevilBro's Plugins
* @invite Jx3TjNS * @invite Jx3TjNS
* @donate https://www.paypal.me/MircoWittrien * @donate https://www.paypal.me/MircoWittrien
@ -19,10 +19,15 @@ module.exports = (_ => {
"info": { "info": {
"name": "BDFDB", "name": "BDFDB",
"author": "DevilBro", "author": "DevilBro",
"version": "1.7.12", "version": "1.7.13",
"description": "Required Library for DevilBro's Plugins" "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 = {}; const DiscordObjects = {};
@ -5882,9 +5887,10 @@ module.exports = (_ => {
.replace(/\$month/g, timeObj.toLocaleDateString(language, {month: "long"})) .replace(/\$month/g, timeObj.toLocaleDateString(language, {month: "long"}))
.replace(/\$dayS/g, timeObj.toLocaleDateString(language, {weekday: "short"})) .replace(/\$dayS/g, timeObj.toLocaleDateString(language, {weekday: "short"}))
.replace(/\$day/g, timeObj.toLocaleDateString(language, {weekday: "long"})) .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(/\$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 > 1 ? BDFDB.LanguageUtils.LanguageStringsFormat(`GAME_LIBRARY_LAST_PLAYED_DAYS`, 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 > 1 ? date : 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) { InternalComponents.LibraryComponents.DateInput.formatDate = function (data, time) {
if (typeof data == "string") data = {dateString: data}; if (typeof data == "string") data = {dateString: data};
@ -5902,7 +5908,8 @@ module.exports = (_ => {
.replace(/\$mm/g, timeObj.toLocaleDateString(language, {month: "2-digit"})) .replace(/\$mm/g, timeObj.toLocaleDateString(language, {month: "2-digit"}))
.replace(/\$m/g, timeObj.toLocaleDateString(language, {month: "numeric"})) .replace(/\$m/g, timeObj.toLocaleDateString(language, {month: "numeric"}))
.replace(/\$yyyy/g, timeObj.toLocaleDateString(language, {year: "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) { InternalComponents.LibraryComponents.DateInput.formatTime = function (data, time, hour12) {
if (typeof data == "string") data = {timeString: data}; if (typeof data == "string") data = {timeString: data};
@ -5929,7 +5936,8 @@ module.exports = (_ => {
.replace(/\$ss/g, seconds < 10 ? `0${seconds}` : seconds) .replace(/\$ss/g, seconds < 10 ? `0${seconds}` : seconds)
.replace(/\$s/g, seconds) .replace(/\$s/g, seconds)
.replace(/\$uu/g, milli < 10 ? `00${seconds}` : milli < 100 ? `0${milli}` : milli) .replace(/\$uu/g, milli < 10 ? `00${seconds}` : milli < 100 ? `0${milli}` : milli)
.replace(/\$u/g, milli); .replace(/\$u/g, milli)
.trim();
let digits = "\\d"; let digits = "\\d";
if (BDFDB.LanguageUtils.languages[language] && BDFDB.LanguageUtils.languages[language].numberMap) { if (BDFDB.LanguageUtils.languages[language] && BDFDB.LanguageUtils.languages[language].numberMap) {

View File

@ -1148,7 +1148,7 @@
"AuditLogPopout": {"props": ["guildSettingsAuditLogsUserFilterPopout"]}, "AuditLogPopout": {"props": ["guildSettingsAuditLogsUserFilterPopout"]},
"AuthBox": {"props": ["authBox"]}, "AuthBox": {"props": ["authBox"]},
"Autocomplete": {"props": ["autocomplete", "autocompleteRow"]}, "Autocomplete": {"props": ["autocomplete", "autocompleteRow"]},
"AutocompleteAliases": {"props": ["autocompleteLayer", "stickerAutoComplete"]}, "AutocompleteAliases": {"props": ["autocomplete", "stickerAutoComplete"]},
"Avatar": {"props": ["avatar", "mask", "wrapper"]}, "Avatar": {"props": ["avatar", "mask", "wrapper"]},
"AvatarIcon": {"props": ["iconActiveLarge", "iconActiveMedium"]}, "AvatarIcon": {"props": ["iconActiveLarge", "iconActiveMedium"]},
"Backdrop": {"props": ["backdrop", "withLayer"]}, "Backdrop": {"props": ["backdrop", "withLayer"]},