Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified bin/DatePicker.adc
Binary file not shown.
10 changes: 9 additions & 1 deletion changelog.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
Version 1.0.0

- Feature 1
- Feature 2
- Feature 2

v2.0.0 : English only version of the datepicker
v2.0.2 - Added aria-labels for input text
v3.0.3 - Date format issue
v3.0.4 - moment.js upgrade
v3.0.5 - pikaday update
v3.0.6 - added minScript and maxScript to allow min & max dates to be set via AskiaScript instead solely off of CurrentQuestion params

28 changes: 19 additions & 9 deletions config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,9 @@
<info>
<name>DatePicker</name>
<guid>b6c04b51-32c5-4591-ba77-a500d686e5e3</guid>
<version>3.0.5</version>
<version>3.0.6</version>
<date>2022-09-13</date>
<description><![CDATA[
v2.0.0 : English only version of the datepicker
v2.0.2 - Added aria-labels for input text
v3.0.3 - Date format issue
v3.0.4 - moment.js upgrade
v3.0.5 - pikaday update
]]></description>
<description><![CDATA[]]></description>
<company>Askia</company>
<author><![CDATA[Jatin Bhatt]]></author>
<site>www.askia.com</site>
Expand Down Expand Up @@ -80,6 +74,22 @@
Format: MM/DD/YYYY]]></description>
<value></value>
</property>
<property xsi:type="standardProperty" id="useScript" name="Askiascript for Min/Max" type="string" mode="dynamic" require="false" visible="true">
<description><![CDATA[Use Askiascript to set the Min Max dates in the control.]]></description>
<value><![CDATA[0]]></value>
<options>
<option value="1" text="Yes" />
<option value="0" text="No" />
</options>
</property>
<property xsi:type="standardProperty" id="minScript" name="Min Date" type="string" mode="dynamic" require="false" visible="true">
<description><![CDATA[0]]></description>
<value></value>
</property>
<property xsi:type="standardProperty" id="maxScript" name="Max Date" type="string" mode="dynamic" require="false" visible="true">
<description><![CDATA[0]]></description>
<value></value>
</property>
<property xsi:type="standardProperty" id="bound" name="Show datepicker" type="string" mode="dynamic" require="false" visible="true">
<description><![CDATA[Hide datepicker by default. Hide datepicker until it is in focus.]]></description>
<value><![CDATA[1]]></value>
Expand Down Expand Up @@ -158,4 +168,4 @@ Format: MM/DD/YYYY]]></description>
</property>
</category>
</properties>
</control>
</control>
16 changes: 14 additions & 2 deletions resources/dynamic/default.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
dim inputNameX = CurrentQuestion.InputName("date")

dim defaultDate = CurrentADC.PropValue("defaultDate").ToString()
dim useScript = CurrentADC.PropValue("useScript").ToNumber()
dim minScript = CurrentADC.PropValue("minScript")
dim maxScript = CurrentADC.PropValue("maxScript")
dim bound = CurrentADC.PropValue("bound")
dim position = "'"+CurrentADC.PropValue("position").ToString()+"'"
dim setDefaultDate = CurrentADC.PropValue("setDefaultDate")
Expand All @@ -12,8 +15,9 @@ dim showWeekNumber = CurrentADC.PropValue("showWeekNumber")
dim showMonthAfterYear = CurrentADC.PropValue("showMonthAfterYear")
dim numberOfMonths = CurrentADC.PropValue("numberOfMonths")
dim mainCalendar = "'"+CurrentADC.PropValue("mainCalendar")+"'"
dim minDate = CurrentQuestion.MinDate.Format("yyyy-MM-dd")
dim maxDate = CurrentQuestion.MaxDate.Format("yyyy-MM-dd")

dim minDate
dim maxDate

dim minBound = CurrentQuestion.MinDate.Format("yyyy").ToNumber()
dim maxBound = CurrentQuestion.MaxDate.Format("yyyy").ToNumber()
Expand All @@ -25,6 +29,14 @@ EndIf
if CvDkNa(maxBound) < 1 Then
maxBound = 2100
EndIf

if (useScript) = 1 Then
minDate = minScript.ToString()
maxDate = maxScript.ToString()
else
minDate = CurrentQuestion.MinDate.Format("yyyy-MM-dd")
maxDate = CurrentQuestion.MaxDate.Format("yyyy-MM-dd")
EndIf
%}

//Validate inputs
Expand Down