Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
JCWasmx86 opened this issue Apr 23, 2024 · 2 comments · Fixed by #15821
Closed

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

JCWasmx86 opened this issue Apr 23, 2024 · 2 comments · Fixed by #15821
Assignees
Labels
status: accepted This issue has been accepted for implementation type: feature Introduction of new functionality to the application

Comments

@JCWasmx86
Copy link
Contributor

JCWasmx86 commented Apr 23, 2024

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

@JCWasmx86 JCWasmx86 added status: needs triage This issue is awaiting triage by a maintainer type: feature Introduction of new functionality to the application labels Apr 23, 2024
JCWasmx86 added a commit to JCWasmx86/netbox that referenced this issue Apr 23, 2024
JCWasmx86 added a commit to JCWasmx86/netbox that referenced this issue Apr 23, 2024
JCWasmx86 added a commit to JCWasmx86/netbox that referenced this issue Apr 23, 2024
JCWasmx86 added a commit to JCWasmx86/netbox that referenced this issue Apr 23, 2024
@jeremystretch jeremystretch added status: accepted This issue has been accepted for implementation and removed status: needs triage This issue is awaiting triage by a maintainer labels Apr 23, 2024
@jeremystretch
Copy link
Member

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.

@JCWasmx86
Copy link
Contributor Author

Yes, I will do that.

@JCWasmx86 JCWasmx86 changed the title Add DateVar for scripts to allow much easier date input Add Date(Time)Var for scripts to allow much easier date input Apr 23, 2024
JCWasmx86 added a commit to JCWasmx86/netbox that referenced this issue Apr 23, 2024
jeremystretch added a commit that referenced this issue Apr 29, 2024
#15821)

* Fixes #15812: Add Date(Time)Var for scripts to allow much easier date input

* Extend tests for invalid data

---------

Co-authored-by: Jeremy Stretch <jstretch@netboxlabs.com>
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 29, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status: accepted This issue has been accepted for implementation type: feature Introduction of new functionality to the application
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants