Add Date(Time)Var for scripts to allow much easier date input #9517

Closed
opened 2025-12-29 20:50:52 +01:00 by adam · 2 comments
Owner

Originally created by @JCWasmx86 on GitHub (Apr 23, 2024).

Originally assigned to: @JCWasmx86 on GitHub.

NetBox version

v3.7.6

Feature type

New functionality

Proposed functionality

Add a new DateVar that allows people that want to run a script to provide a date with a datepicker, not with e.g. just a simple text input field.

image

I will provide patches, if this issue is accepted => You can assign me to this issue

Use case

For users of scripts: No need to check out the date format? Is it YYYY-MM-DD or YYYY-DD-MM etc. It makes selecting input easier. Furthermore if you submit an invalid date (E.g. 2024-02-31) this would be already rejected during the form submission

For developers of scripts: No need to manually parse dates => Less code, less error handling in case of invalid input.

Database changes

None

External dependencies

None

Originally created by @JCWasmx86 on GitHub (Apr 23, 2024). Originally assigned to: @JCWasmx86 on GitHub. ### NetBox version v3.7.6 ### Feature type New functionality ### Proposed functionality Add a new `DateVar` that allows people that want to run a script to provide a date with a datepicker, not with e.g. just a simple text input field. ![image](https://github.com/netbox-community/netbox/assets/63594136/4a225eb4-5ff0-4dbf-bd1a-74fa45bdb001) ***I will provide patches, if this issue is accepted => You can assign me to this issue*** ### Use case For users of scripts: No need to check out the date format? Is it YYYY-MM-DD or YYYY-DD-MM etc. It makes selecting input easier. Furthermore if you submit an invalid date (E.g. 2024-02-31) this would be already rejected during the form submission For developers of scripts: No need to manually parse dates => Less code, less error handling in case of invalid input. ### Database changes None ### External dependencies None
adam added the status: acceptedtype: feature labels 2025-12-29 20:50:52 +01:00
adam closed this issue 2025-12-29 20:50:52 +01:00
Author
Owner

@jeremystretch commented on GitHub (Apr 23, 2024):

Thanks for volunteering @JCWasmx86! What do you think about adding a DateTimeVar while we're at it, to convey a specific date & time? I'd expect it can be done with very little additional work.

@jeremystretch commented on GitHub (Apr 23, 2024): Thanks for volunteering @JCWasmx86! What do you think about adding a DateTimeVar while we're at it, to convey a specific date & time? I'd expect it can be done with very little additional work.
Author
Owner

@JCWasmx86 commented on GitHub (Apr 23, 2024):

Yes, I will do that.

@JCWasmx86 commented on GitHub (Apr 23, 2024): Yes, I will do that.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#9517