Set constrain for dates appearing in non-Gregorian calendars

I need to set date constrain for dates that appear in non-Gregorian calendars (Bikram Sambat calendar in particular). I tries using
">=date('YYYY-MM-DD') and <=date('YYYY-MM-DD')" in the XFORM constrain field but it did not work. Is there any way that I could set data constrain for Bikram Sambat date between 2069-11-01 to 2074-04-32? FYI: the Bikram Sambat date above is between 2013-02-12 and 2018-01-14 when converted to AD.

Hi @Binaya_Chalise
welcome to the forum! Please introduce yourself here!

all those non-Gregorian calendars like Bikram Sambat/Ethiopian/Coptic etc are just appearances. that means dates are displayed in that particular formats but under the hood when you save your form in xml file we use Gregorian dates for all. Because of that creating constraints you need to set Gregorian dates in all the cases no matter what appearance you use.
So your constraint should be like:
.>= date('2013-02-12') and .<= date('2018-01-14')
BikramSambat-export.xlsx (8.1 KB)

1 Like

Thank you so much for the example in XLS. It worked for me.

1 Like