mirror of
				https://github.com/TriliumNext/Notes.git
				synced 2025-11-04 15:11:31 +08:00 
			
		
		
		
	fix: 🐛 fix calendar option error
This commit is contained in:
		
							parent
							
								
									a80932d3f9
								
							
						
					
					
						commit
						ae7aaaf263
					
				@ -58,9 +58,9 @@ const TPL = `
 | 
				
			|||||||
        <div class="option-row min-days-row" style="display: none;">
 | 
					        <div class="option-row min-days-row" style="display: none;">
 | 
				
			||||||
            <label for="min-days-in-first-week">${t("i18n.min-days-in-first-week")}</label>
 | 
					            <label for="min-days-in-first-week">${t("i18n.min-days-in-first-week")}</label>
 | 
				
			||||||
            <select id="min-days-in-first-week" class="form-select">
 | 
					            <select id="min-days-in-first-week" class="form-select">
 | 
				
			||||||
                ${Array.from({length: 7}, (_, i) => i + 1)
 | 
					                ${Array.from({ length: 7 }, (_, i) => i + 1)
 | 
				
			||||||
                    .map(num => `<option value="${num}">${num}</option>`)
 | 
					        .map(num => `<option value="${num}">${num}</option>`)
 | 
				
			||||||
                    .join('')}
 | 
					        .join('')}
 | 
				
			||||||
            </select>
 | 
					            </select>
 | 
				
			||||||
        </div>
 | 
					        </div>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -148,6 +148,8 @@ export default class LocalizationOptions extends OptionsWidget {
 | 
				
			|||||||
            } else {
 | 
					            } else {
 | 
				
			||||||
                $minDaysRow.hide();
 | 
					                $minDaysRow.hide();
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            this.updateOption("firstWeekOfYear", value);
 | 
				
			||||||
        });
 | 
					        });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        const currentValue = this.$widget.find('input[name="first-week-of-year"]:checked').val();
 | 
					        const currentValue = this.$widget.find('input[name="first-week-of-year"]:checked').val();
 | 
				
			||||||
@ -156,7 +158,7 @@ export default class LocalizationOptions extends OptionsWidget {
 | 
				
			|||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        this.$widget.find("#min-days-in-first-week").on("change", () => {
 | 
					        this.$widget.find("#min-days-in-first-week").on("change", () => {
 | 
				
			||||||
            const minDays = String(this.$widget.find("#min-days-in-first-week").val());
 | 
					            const minDays = this.$widget.find("#min-days-in-first-week").val();
 | 
				
			||||||
            this.updateOption("minDaysInFirstWeek", minDays);
 | 
					            this.updateOption("minDaysInFirstWeek", minDays);
 | 
				
			||||||
        });
 | 
					        });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -1,4 +1,4 @@
 | 
				
			|||||||
import type { FilterOptionsByType, OptionDefinitions, OptionMap, OptionNames } from "../../../../../services/options_interface.js";
 | 
					import type { FilterOptionsByType, OptionMap, OptionNames } from "../../../../../services/options_interface.js";
 | 
				
			||||||
import type { EventData, EventListener } from "../../../components/app_context.js";
 | 
					import type { EventData, EventListener } from "../../../components/app_context.js";
 | 
				
			||||||
import type FNote from "../../../entities/fnote.js";
 | 
					import type FNote from "../../../entities/fnote.js";
 | 
				
			||||||
import { t } from "../../../services/i18n.js";
 | 
					import { t } from "../../../services/i18n.js";
 | 
				
			||||||
@ -45,7 +45,7 @@ export default class OptionsWidget extends NoteContextAwareWidget implements Eve
 | 
				
			|||||||
        $checkbox.prop("checked", optionValue === "true");
 | 
					        $checkbox.prop("checked", optionValue === "true");
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    optionsLoaded(options: OptionMap) {}
 | 
					    optionsLoaded(options: OptionMap) { }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    async refresh() {
 | 
					    async refresh() {
 | 
				
			||||||
        this.toggleInt(this.isEnabled());
 | 
					        this.toggleInt(this.isEnabled());
 | 
				
			||||||
 | 
				
			|||||||
@ -72,6 +72,8 @@ const ALLOWED_OPTIONS = new Set<OptionNames>([
 | 
				
			|||||||
    "locale",
 | 
					    "locale",
 | 
				
			||||||
    "formattingLocale",
 | 
					    "formattingLocale",
 | 
				
			||||||
    "firstDayOfWeek",
 | 
					    "firstDayOfWeek",
 | 
				
			||||||
 | 
					    "firstWeekOfYear",
 | 
				
			||||||
 | 
					    "minDaysInFirstWeek",
 | 
				
			||||||
    "languages",
 | 
					    "languages",
 | 
				
			||||||
    "textNoteEditorType",
 | 
					    "textNoteEditorType",
 | 
				
			||||||
    "textNoteEditorMultilineToolbar",
 | 
					    "textNoteEditorMultilineToolbar",
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user