Skip to content

Commit 9ff8244

Browse files
committed
comment: Remove commented-out remnants of earlier date-picker implementation in DateEditor
1 parent 1461ba4 commit 9ff8244

File tree

2 files changed

+0
-85
lines changed

2 files changed

+0
-85
lines changed

src/ui/DateEditor.svelte

Lines changed: 0 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,6 @@
1212
1313
// Use this for testing purposes only
1414
export let parsedDate: string = '';
15-
// let inputElement: HTMLInputElement;
16-
// let flatpickrInstance: any;
17-
//
18-
// const dispatch = createEventDispatcher();
19-
//
20-
// const iconCalendarDays = (node: HTMLElement) => {
21-
// // For a more general implementation, see:
22-
// // https://github.com/joethei/obsidian-rss/blob/b600e2ead2505d58aa3e4c7898795bbf58fa3cdc/src/view/IconComponent.svelte
23-
// setIcon(node, 'calendar-days');
24-
// };
2515
2616
let pickedDate = '';
2717
@@ -43,60 +33,6 @@
4333
4434
// 'weekend' abbreviation omitted due to lack of space.
4535
const datePlaceholder = "Try 'Mon' or 'tm' then space";
46-
47-
/**
48-
* A calendar date picker which is not tied to any particular date field.
49-
*
50-
* See also {@link promptForDate}
51-
*/
52-
// function openDatePicker() {
53-
// if (inputElement) {
54-
// if (flatpickrInstance) {
55-
// flatpickrInstance.destroy(); // Destroy any existing instance to avoid conflicts
56-
// }
57-
//
58-
// const options: Record<string, any> = {
59-
// enableTime: false,
60-
// dateFormat: 'Y-m-d',
61-
// locale: {
62-
// firstDayOfWeek: 1,
63-
// },
64-
// onClose: (selectedDates: Date[]) => {
65-
// dispatch('close', { instance: flatpickrInstance }); // Notify parent about close
66-
//
67-
// if (selectedDates.length > 0) {
68-
// const selectedDate = selectedDates[0];
69-
// date = window.moment(selectedDate).format('YYYY-MM-DD');
70-
// }
71-
//
72-
// flatpickrInstance.destroy(); // Destroy the instance after the date is selected
73-
// flatpickrInstance = null;
74-
// },
75-
// allowInput: true, // Allow manual input to keep the field empty if no selection is made
76-
// defaultDate: undefined, // Explicitly define defaultDate with undefined
77-
// };
78-
//
79-
// // We don't use parseDate() here as we want to strictly only match exact dates,
80-
// // and not words like 'today' or 'tomorrow', to make sure we really
81-
// // are using the already-parsed date in the Modal UI:
82-
// const dateMatcher = /^\d{4}-\d{2}-\d{2}$/;
83-
// if (parsedDate.match(dateMatcher)) {
84-
// // This is where the user had typed, for example, 'tomorrow' in the input
85-
// // field, and chrono has converted that to an exact date.
86-
// options.defaultDate = new Date(parsedDate);
87-
// } else if (date.match(dateMatcher)) {
88-
// // This is a precaution, for the unlikely event that the input field
89-
// // contains a parsed date, but the parsedDate does not.
90-
// // It's possible that it is unreachable, but we would need tests to confirm that.
91-
// options.defaultDate = new Date(date);
92-
// }
93-
//
94-
// flatpickrInstance = flatpickr(inputElement, options);
95-
// dispatch('open', { instance: flatpickrInstance }); // Notify parent about open
96-
//
97-
// flatpickrInstance.open(); // Directly open the date picker
98-
// }
99-
// }
10036
</script>
10137

10238
<label for={id}>{@html labelContentWithAccessKey(id, accesskey)}</label>
@@ -111,13 +47,6 @@
11147
{accesskey}
11248
/>
11349

114-
<!--<button-->
115-
<!-- class="tasks-modal-calendar-button"-->
116-
<!-- use:iconCalendarDays-->
117-
<!-- on:click={openDatePicker}-->
118-
<!-- aria-label="Open date picker"-->
119-
<!-- style="background: none; border: none; padding: 0; cursor: pointer;"-->
120-
<!--/>-->
12150
{#if isDateValid}
12251
<div class="tasks-modal-parsed-date">
12352
{dateSymbol}<input

src/ui/EditTask.scss

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -77,19 +77,13 @@
7777
}
7878

7979
.tasks-modal-date-input {
80-
//grid-column: 2;
8180
min-width: 15em;
8281
}
8382

8483
.tasks-modal-date-editor-picker {
8584
margin-left: .5em;
8685
}
8786

88-
//.tasks-modal-calendar-button {
89-
// grid-column: 3;
90-
// color: var(--text-muted);
91-
//}
92-
9387
.tasks-modal-parsed-date {
9488
grid-column: 3;
9589
font-size: var(--font-ui-small);
@@ -166,10 +160,6 @@
166160
grid-column: 1;
167161
}
168162

169-
//.tasks-modal-calendar-button {
170-
// grid-column: 2;
171-
//}
172-
173163
.tasks-modal-parsed-date {
174164
grid-column: 2;
175165
}
@@ -196,10 +186,6 @@
196186
grid-column: 1;
197187
}
198188

199-
//.tasks-modal-calendar-button {
200-
// grid-column: 1;
201-
//}
202-
203189
> .tasks-modal-parsed-date {
204190
grid-column: 1;
205191
}

0 commit comments

Comments
 (0)