From 2844331f1043137d57e0ada0441e89689900dbbc Mon Sep 17 00:00:00 2001 From: iamvann Date: Sat, 17 May 2025 01:26:26 +0800 Subject: [PATCH] docs(options):Ensures UI descriptions accurately reflect Day.js handling of unrecognized format --- .../options/text_notes/date_time_format.js | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/public/app/widgets/type_widgets/options/text_notes/date_time_format.js b/src/public/app/widgets/type_widgets/options/text_notes/date_time_format.js index 96d70665e..7eb5916c3 100644 --- a/src/public/app/widgets/type_widgets/options/text_notes/date_time_format.js +++ b/src/public/app/widgets/type_widgets/options/text_notes/date_time_format.js @@ -9,11 +9,13 @@ const TPL = ` Uses Day.js format tokens. Refer to the Day.js documentation for valid tokens.

-

- Important: If you provide a string that Day.js cannot interpret as a format, - the literal string you typed might be inserted. If the format string is empty, or if Day.js - encounters an internal error with your format, a default format (e.g., YYYY-MM-DD HH:mm) will be used. -

+

+ Important: If you provide a format string that Day.js does not recognize + (e.g., mostly plain text without valid Day.js tokens), + the text you typed might be inserted literally. If the format string is left empty, + or if Day.js encounters a critical internal error with your format, + a default format (e.g., YYYY-MM-DD HH:mm) will be used. +

@@ -39,8 +41,8 @@ export default class DateTimeFormatOptions extends OptionsWidget { //listen to input this.$formatInput.on("input", () => { const formatString = this.$formatInput.val(); - - this.updateOption("customDateTimeFormatString", formatString); + + this.updateOption("customDateTimeFormatString", formatString); }); return this.$widget; //render method to return the widget @@ -49,7 +51,7 @@ export default class DateTimeFormatOptions extends OptionsWidget { async optionsLoaded(options) { const currentFormat = options.customDateTimeFormatString || ""; - + if (this.$formatInput) { this.$formatInput.val(currentFormat); } else {