Hello Community,
With the updated date picker, i dont see any disabled days option anymore
Can somebody help me weather its removed or is there any workaround?
Thanks,
Krunal
Hi Krunal,
To notify the OutSystems team about the mentioned configuration limitation in the updated datepicker widget, I'm tagging the OutSystemsUI to this post.
However, I do have a workaround to suggest for your use case.
Implementation Steps:
JavaScript Snippet:
function toISODate(d) { var z = function(n) {return ('0' + n).slice(-2);}; return d.getFullYear() + '-' + z(d.getMonth()+1) + '-' + z(d.getDate()); } function specificDays(date) { var rdatedData = JSON.parse($parameters.SpecificDays); return rdatedData.includes (toISODate(date)); } function weekends(date) { return (date.getDay() === 0 || date.getDay() === 6); } var dataPickerProvider = OutSystems.OSUI.Patterns.DatePickerAPI.GetDatePickerItemById($parameters.DatePickerWidgetId)._provider; dataPickerProvider.config._disable = [weekends, specificDays]; dataPickerProvider.clear();
Demo Screen: DisableDays_DatepickerTask
Refer to the attached oml
Refer to the FlatPickr Documentation: #disabling-dates-by-a-function
I hope this helps you!
Kind regards,
Benjith Sam
It is there.
Are you looking for MinDate()
Shubham
Hello Shubham,
No, I want to pass a list of dates which i want to diable as well as weekends i want to disable.
Old date picker used to have those options directly available
Thanks Benjit
I will give this a try.
You're welcome, Krunal.
Glad to help you :)
Hello.
In OutSystems UI version 2.12.0 planned for the end of October, we'll make client actions available to disable a list of days and choose weekdays to disable.
Cheers,GM
Thank you, Gonçalo, for the update.
@Gonçalo Martins is this feature available now or has it not been released yet ?
Hello @Gaetano Cerciello
As you can check on the release notes for version 2.12.0 under the codes ROU-3301 and ROU-3381, these features are already available on the product.
DatePicker does not work: it is not updated with value on client events.
Hello @Dmitrii Lubenskii!
Can you give more details about what is not working on DatePicker and how can I reproduce the issue?
Regards,
Giuliana.
Hi,
Only one way to workaround it is put DatePicker inside an IF, and show it in UI only when a new value is set.
Thank you for your reply.
"If some other event is fired, and I change DatePicker variable assigned to it, then DatePicker is not updated with a new value in UI."
"If DatePicker set Enabled = false, then if I change Enabled condition in a client event, then it stays disabled."