Join Discord
Communities
Powered by
Validating dates with date picker in Umbraco
# help-with-umbraco
t
TigerMan
11/20/2024, 12:54 PM
Hi I'm using the default date picker in Umbraco. I have two added to my document type. Is there anyway to validate the first date picker selected date is not after the second date picker? Thanks
l
Lamont
11/20/2024, 3:39 PM
Have you tried DateTime.Compare (if .Net 9)? Or GreaterThan (.Net 8)? Assuming you're writing C#, and depending on what version of Umbraco you're running (thus what version of .Net), there are lots of available methods for datetimes :3
https://learn.microsoft.com/en-us/dotnet/api/system.datetime.compare?view=net-9.0
11
Views
Previous
Next