import { App , FuzzySuggestModal } from "obsidian" ; class DateTimeFormatModal extends FuzzySuggestModal < string > { constructor ( app , private suggestions , private onChooseSuggestionFunc ) { super ( app ) ; } getItems ( ) { return this . suggestions ; } getItemText ( item ) { return item ; } onChooseItem ( item , evt ) { this . onChooseSuggestionFunc ( item ) ; } } export function openDateTimeFormatChooser ( app , onSelectFormat ) { new DateTimeFormatModal ( app , [ "YYYY-MM-DD" , "YYYY/MM/DD" , "DD-MM-YYYY" , "DD/MM/YYYY" ] , ( dateFormat ) => { new DateTimeFormatModal ( app , [ "YYYY-MM-DD HH:mm" , "YYYY/MM/DD HH:mm" , "DD-MM-YYYY HH:mm" , "DD/MM/YYYY HH:mm" , "YYYY-MM-DDTHH:mm:ss:SSS" ] , ( dateTimeFormat ) => { onSelectFormat ( dateFormat , dateTimeFormat ) ; } ) . open ( ) ; } ) . open ( ) ; }