(container: HTMLElement)
| 259 | } |
| 260 | |
| 261 | private renderActions(container: HTMLElement): void { |
| 262 | const actions = container.createDiv({ cls: "date-time-picker-modal__actions" }); |
| 263 | |
| 264 | if (this.options.currentDate) { |
| 265 | const clearButton = actions.createEl("button", { |
| 266 | text: "Clear date", |
| 267 | cls: "date-time-picker-modal__action-button", |
| 268 | attr: { type: "button" }, |
| 269 | }); |
| 270 | clearButton.addEventListener("click", () => { |
| 271 | this.options.onSelect(null, null); |
| 272 | this.close(); |
| 273 | }); |
| 274 | } |
| 275 | |
| 276 | const cancelButton = actions.createEl("button", { |
| 277 | text: "Cancel", |
| 278 | cls: "date-time-picker-modal__action-button", |
| 279 | attr: { type: "button" }, |
| 280 | }); |
| 281 | cancelButton.addEventListener("click", () => this.close()); |
| 282 | |
| 283 | this.selectButtonEl = actions.createEl("button", { |
| 284 | text: "Select", |
| 285 | cls: "mod-cta date-time-picker-modal__action-button", |
| 286 | attr: { type: "button" }, |
| 287 | }); |
| 288 | this.selectButtonEl.addEventListener("click", () => this.confirmSelectedDate()); |
| 289 | } |
| 290 | |
| 291 | private selectDate(date: string): void { |
| 292 | this.updateSelectedDate(date); |
no test coverage detected