Datepicker default display issue

Good morning.   I'm working on a date span entry where users will select a "From Date" using a controls/datepicker and then will select a "To Date" using a different datepicker.   I would like the default entry to show "YYYY/MM/DD"  and I was able to accomplish this using the BeginEmpty:true setting in advanced settings.

The issue I'm having is that my From/To logic require the datepickers to know about the selection of the other.   Basically I'm allowing the users to select up to a 90 day span at any point in the past year.   (example, if a user selects a from date of 12/1/2018 they will only be allowed to select a ToDate of 12/1/2018 to 3/1/2019)  So when a selection is made I have to refresh the container that holds the datepickers so variables are known by the other picker.      When the refresh of the container occurs BeginEmpty:true setting is reapplied and the selection is wiped out.


If I remove the BeginEmpty formatting my logic works great and date selection is constrained as expected.  But by default it plugs the current date in for both the From and To Dates, and that looks unfinished.   Any ideas?


Here is an example of what is occurring.

Solution

Hi Josh,

Try this on AdvanceFormat 

SyntaxEditor Code Snippet

If(FromDate = NullDate(),"{BeginEmpty:true}","")

Regards,

Marcelo

Solution

This is perfect.. I didn't realize the If statement was allowed in the AdvancedFormat section.   Much appreciated.