@@ -16,27 +16,59 @@ export default function InsertDropdown({ onRuler, onIndent1, onIndent2, onList1,
1616 < button
1717 className = "dropdown-item"
1818 onClick = { ( ) => {
19- // insert a simple link to the project homepage
20- onInsertTemplate ( '[EasyEdit HomePage](https://github.com/gcclinux/easyedit)' ) ;
19+ const date = new Date ( ) ;
20+ const parts = date . toString ( ) . split ( ' ' ) ;
21+ // parts: ['Sun', 'Dec', '21', '2025', '22:05:41', 'GMT+0000', '(Coordinated', 'Universal', 'Time)']
22+ // We need time in AM/PM.
23+ const time = date . toLocaleTimeString ( 'en-US' , { hour12 : true } ) ; // "10:05:29 PM"
24+ // We need timezone. 'GMT' is hardcoded in user request example but might imply local.
25+ // If we want exactly "Sun Dec 21 10:05:29 PM GMT 2025":
26+ // Let's assume the user wants their local time representation but formatted this way.
27+ // Getting explicit "GMT" or "EST" is flaky in JS without libraries.
28+ // However, `date.toString()` usually gives `GMT-0500` or similar.
29+
30+ // Let's try to stick to a slightly cleaner native string if possible, or build it.
31+ // User asked for: Sun Dec 21 10:05:29 PM GMT 2025
32+
33+ const dayName = parts [ 0 ] ; // Sun
34+ const month = parts [ 1 ] ; // Dec
35+ const day = parts [ 2 ] ; // 21
36+ const year = parts [ 3 ] ; // 2025
37+
38+ // To format nicely:
39+ const dateStr = `${ dayName } ${ month } ${ day } ${ time } GMT ${ year } ` ;
40+ onInsertTemplate ( dateStr ) ;
41+ onClose ( ) ;
42+ } }
43+ >
44+ < div className = "hdr-title" > Date</ div >
45+ < div className = "hdr-desc" > < em > Today's date</ em > </ div >
46+ < div className = "hdr-sep" />
47+ </ button >
48+ < button
49+ className = "dropdown-item"
50+ onClick = { ( ) => {
51+ // insert a simple link to the project homepage
52+ onInsertTemplate ( '[EasyEdit HomePage](https://github.com/gcclinux/easyedit)' ) ;
2153 onClose ( ) ;
2254 } }
2355 >
2456 < div className = "hdr-title" > Link</ div >
2557 < div className = "hdr-desc" > < em > Simple link</ em > </ div >
2658 < div className = "hdr-sep" />
2759 </ button >
28- < button
29- className = "dropdown-item"
30- onClick = { ( ) => {
31- // insert a checklist example
32- onInsertTemplate ( '- [ ] This item is unchecked\n- [X] This item is checked\n' ) ;
33- onClose ( ) ;
34- } }
35- >
36- < div className = "hdr-title" > Checklist</ div >
37- < div className = "hdr-desc" > < em > Insert a checked / unchecked list</ em > </ div >
38- < div className = "hdr-sep" />
39- </ button >
60+ < button
61+ className = "dropdown-item"
62+ onClick = { ( ) => {
63+ // insert a checklist example
64+ onInsertTemplate ( '- [ ] This item is unchecked\n- [X] This item is checked\n' ) ;
65+ onClose ( ) ;
66+ } }
67+ >
68+ < div className = "hdr-title" > Checklist</ div >
69+ < div className = "hdr-desc" > < em > Insert a checked / unchecked list</ em > </ div >
70+ < div className = "hdr-sep" />
71+ </ button >
4072 < button className = "dropdown-item" onClick = { ( ) => { onRuler ( ) ; onClose ( ) ; } } >
4173 < div className = "hdr-title" > Ruler</ div >
4274 < div className = "hdr-desc" > < em > Markdown ruler / page split</ em > </ div >
0 commit comments