This commit is contained in:
Mirco Wittrien 2021-08-11 20:32:10 +02:00
parent 46ffcea89c
commit 8a4e959eac
2 changed files with 13 additions and 2 deletions

View File

@ -5889,7 +5889,18 @@ module.exports = (_ => {
return date.toLocaleString(language).replace(date.toLocaleDateString(language), "$date").replace(date.toLocaleTimeString(language, {hourCycle: "h12"}), "$time12").replace(date.toLocaleTimeString(language, {hourCycle: "h11"}), "$time12").replace(date.toLocaleTimeString(language, {hourCycle: "h24"}), "$time").replace(date.toLocaleTimeString(language, {hourCycle: "h23"}), "$time");
};
InternalComponents.LibraryComponents.DateInput.parseDate = function (date, offset) {
let timeObj = typeof date == "string" || typeof date == "number" ? new Date(date) : date;
let timeObj = date;
if (typeof timeObj == "string") {
const language = BDFDB.LanguageUtils.getLanguage().id;
for (let i = 0; i < 12; i++) {
const tempDate = new Date();
tempDate.setMonth(i);
timeObj = timeObj.replace(tempDate.toLocaleDateString(language, {month:"long"}), tempDate.toLocaleDateString("en", {month:"short"}));
}
timeObj = new Date(timeObj);
}
else if (typeof timeObj == "number") timeObj = new Date(timeObj);
if (timeObj.toString() == "Invalid Date") timeObj = new Date(parseInt(date));
if (timeObj.toString() == "Invalid Date" || typeof timeObj.toLocaleDateString != "function") timeObj = new Date();
offset = offset != null && parseFloat(offset);

View File

@ -179,7 +179,7 @@ module.exports = (_ => {
e.instance.props._originalText = e.instance.props._originalText || e.instance.props.text;
if (this.settings.general.showInMarkup) {
if (tooltipIsSame) e.instance.props.delay = 99999999999999999999;
let timestamp = this.formatTimestamp(this.settings.dates.timestampDate, new Date(e.instance.props._originalText));
let timestamp = this.formatTimestamp(this.settings.dates.timestampDate, e.instance.props._originalText);
let renderChildren = e.instance.props.children;
e.instance.props.children = (...args) => {
let renderedChildren = renderChildren(...args);