[PR #3805] [MERGED] Text input date validation #4091

Closed
opened 2026-04-25 00:18:16 +02:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/advplyr/audiobookshelf/pull/3805
Author: @nichwall
Created: 1/7/2025
Status: Merged
Merged: 1/7/2025
Merged by: @advplyr

Base: masterHead: text_input_date_validation


📝 Commits (4)

  • 2ec84ed Add: episode pubdate validation before saving
  • db17a5c Change: toast date error to be generic
  • 7fd8178 Add: datetime check for new episode modal
  • bea9d6a Update date time input validation, add red border for invalid datetime

📊 Changes

5 files changed (+33 additions, -25 deletions)

View changed files

📝 client/components/modals/item/tabs/Episodes.vue (+4 -0)
📝 client/components/modals/podcast/tabs/EpisodeDetails.vue (+8 -1)
📝 client/components/ui/TextInput.vue (+15 -20)
📝 client/components/ui/TextInputWithLabel.vue (+5 -4)
📝 client/strings/en-us.json (+1 -0)

📄 Description

Brief summary

This PR adds a check for a non-null value for date-time fields in the web client to ensure null is not incorrectly submitted.

Which issue is fixed?

Fixes https://github.com/advplyr/audiobookshelf/issues/3775 and partially fixes https://github.com/advplyr/audiobookshelf/issues/1519

In-depth Description

The submit button now checks that the date-time field to ensure that it is non-null. The datetime will be null if any field (day, month, year, hour, minute) is not set. I added a new error toast to inform the user of the date not being formatted correctly.

We could have the UI element default to 12:00 AM if only the time is not specified, such as is mentioned in #1519, as well as to ensure that different browsers render the "default" time correctly, such as Safari in #3775.

How have you tested this?

Tested the web client with fully valid datetimes, each individual field missing, and no change to the date.
Tested using Firefox.

Screenshots

error toast on edit screen


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/advplyr/audiobookshelf/pull/3805 **Author:** [@nichwall](https://github.com/nichwall) **Created:** 1/7/2025 **Status:** ✅ Merged **Merged:** 1/7/2025 **Merged by:** [@advplyr](https://github.com/advplyr) **Base:** `master` ← **Head:** `text_input_date_validation` --- ### 📝 Commits (4) - [`2ec84ed`](https://github.com/advplyr/audiobookshelf/commit/2ec84edb5e271e7ba73ffc37e79ba4fb092b186a) Add: episode pubdate validation before saving - [`db17a5c`](https://github.com/advplyr/audiobookshelf/commit/db17a5c88b98fdcd4978e43963cd65a1ad6edbfb) Change: toast date error to be generic - [`7fd8178`](https://github.com/advplyr/audiobookshelf/commit/7fd8178ddefc5bbcee42a685a7482b3b957a6112) Add: datetime check for new episode modal - [`bea9d6a`](https://github.com/advplyr/audiobookshelf/commit/bea9d6aff4e000403131f70b1c60065c339acce8) Update date time input validation, add red border for invalid datetime ### 📊 Changes **5 files changed** (+33 additions, -25 deletions) <details> <summary>View changed files</summary> 📝 `client/components/modals/item/tabs/Episodes.vue` (+4 -0) 📝 `client/components/modals/podcast/tabs/EpisodeDetails.vue` (+8 -1) 📝 `client/components/ui/TextInput.vue` (+15 -20) 📝 `client/components/ui/TextInputWithLabel.vue` (+5 -4) 📝 `client/strings/en-us.json` (+1 -0) </details> ### 📄 Description <!-- For Work In Progress Pull Requests, please use the Draft PR feature, see https://github.blog/2019-02-14-introducing-draft-pull-requests/ for further details. If you do not follow this template, the PR may be closed without review. Please ensure all checks pass. If you are a new contributor, the workflows will need to be manually approved before they run. --> ## Brief summary This PR adds a check for a non-null value for date-time fields in the web client to ensure `null` is not incorrectly submitted. ## Which issue is fixed? Fixes https://github.com/advplyr/audiobookshelf/issues/3775 and partially fixes https://github.com/advplyr/audiobookshelf/issues/1519 ## In-depth Description The submit button now checks that the date-time field to ensure that it is non-null. The datetime will be null if any field (day, month, year, hour, minute) is not set. I added a new error toast to inform the user of the date not being formatted correctly. We could have the UI element default to 12:00 AM if only the time is not specified, such as is mentioned in #1519, as well as to ensure that different browsers render the "default" time correctly, such as Safari in #3775. ## How have you tested this? Tested the web client with fully valid datetimes, each individual field missing, and no change to the date. Tested using Firefox. ## Screenshots ![error toast on edit screen](https://github.com/user-attachments/assets/9e7c8698-425b-4221-bed1-7fc3caa40c49) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
adam added the pull-request label 2026-04-25 00:18:16 +02:00
adam closed this issue 2026-04-25 00:18:17 +02:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/audiobookshelf#4091