Joget DX 8 Stable Released
The stable release for Joget DX 8 is now available, with a focus on UX and Governance.
Hi All,
I found out it How to get date picker value and add days at the same form
<script>
$(document).ready(function(){
var dateField = FormUtil.getField(
"cpo_item_plan_del_date"
);
var hiddenField = FormUtil.getField(
"cpo_item_plan_billing"
);
var updateDueDate = function (field, selectedDate) {
console.log($(field));
console.log($(dateField));
if
($(field).attr(
"id"
) === $(dateField).attr(
"id"
)) {
var instance = $(field).data(
"datepicker"
);
var date = $.datepicker.parseDate(instance.settings.dateFormat || $.datepicker._defaults.dateFormat, selectedDate, instance.settings );
date.setDate(date.getDate() +
10
);
var dateString = $.datepicker.formatDate(instance.settings.dateFormat, date, instance.settings);
$(hiddenField).val(dateString);
}
};
$.datepicker.setDefaults({
onSelect: function( selectedDate ) {
updateDueDate(
this
, selectedDate);
}
});
});
</script>
good job, always success..
Hi All,
I have the following:
Form: ht_cpo_item
Two Date Picker fields:
I was trying to use hash variable in Default value of cpo_item_plan_billing with reference to #form.ht_cpo_item.cpo_item_plan_del_date# and somehow add 10 days but no luck.
I have checked hash variable #date.DAY+10.EEE, d MMM yyyy h:mm:ss a# it works but from current date.
Any thoughts?
BR,
Sylwester