Hi I have the datepicker as shown below

In the documentation, the DatePicker looks like this:

Anyway I am trying to disable Sundays and Saturdays through any means, I tried to see if there is any update in Forge Updates for Datepicker, however I cannot see any updates.

Good Day Sir Joseph

I happen to encounter disableweekend, and actually it is already written in the tooltip side of the datepicker. I applied this format in Advanced setting. 


The problem is, the datepicker stops working I dont know why. Any help will be appreciated 


Tran Xuan Phi wrote:

Hope to help you!
https://www.outsystems.com/forums/discussion/41397/disable-all-days-except-saturday-in-datepicker/


Sorry Sir Tran Xuan Phi

I am not quite familiar Javascripting. But I will take this into practice once I understand the concept. Thank you Sir! 

Penny wrote:

Good Day Sir Joseph

I happen to encounter disableweekend, and actually it is already written in the tooltip side of the datepicker. I applied this format in Advanced setting. 


The problem is, the datepicker stops working I dont know why. Any help will be appreciated 


Hi Penny!

Here's a new edition of the DatePickerTest.oml with a working DatePicker.

Best regards,
Joseph Enriquez

Joseph Enriquez wrote:

Penny wrote:

Good Day Sir Joseph

I happen to encounter disableweekend, and actually it is already written in the tooltip side of the datepicker. I applied this format in Advanced setting. 


The problem is, the datepicker stops working I dont know why. Any help will be appreciated 


Hi Penny!

Here's a new edition of the DatePickerTest.oml with a working DatePicker.

Best regards,
Joseph Enriquez


Good Day Sir Joseph,

Thank you for taking your time again to help me, Yes it works it the OML file you sent me. However when I applied it to my project it shows an error of JSON5 is not defined. Do you have any idea sir why this occurs?  

Hi Penny!

The error JSON5 is not defined you encountered comes from a few causes. The most common would be testing a mobile app in the OutSystems browser emulator/simulator instead of a mobile device. If this is the case, then I would recommend testing your project in an actual mobile device instead of the mobile emulator for browsers.

Related reference:
https://www.outsystems.com/forums/discussion/43023/cordova-not-defined-error/


The other cause might be a missing or broken JSON related plugin. In that case...

Related reference:
https://www.outsystems.com/forums/discussion/47928/cordova-plugins-undefined/


Best regards,
Joseph Enriquez

Good Day Sir Joseph,

The scenario is for web display only. No mobile device is being used.

Sorry but I do not quite see if I understand the post properly.

Do I need to place a Cordova Plugin in my preparation? As of now I do not have the plugin available in my ESpace I would do so later. 

Then would I need to define the pikaday github url in this format?

{    "plugin" :{     

   "url": 

"https://github.com/Pikaday/Pikaday"

    }

}

Penny wrote:

Good Day Sir Joseph,

The scenario is for web display only. No mobile device is being used.

Sorry but I do not quite see if I understand the post properly.

Do I need to place a Cordova Plugin in my preparation? As of now I do not have the plugin available in my ESpace I would do so later. 

Then would I need to define the pikaday github url in this format?

{    "plugin" :{     

   "url": 

"https://github.com/Pikaday/Pikaday"

    }

}

Hi Penny!

No need to do so since you're using Web.
Did that JSON 5 not defined error go away?

Kind regards,
Joseph Enriquez

Joseph Enriquez wrote:

Penny wrote:

Good Day Sir Joseph,

The scenario is for web display only. No mobile device is being used.

Sorry but I do not quite see if I understand the post properly.

Do I need to place a Cordova Plugin in my preparation? As of now I do not have the plugin available in my ESpace I would do so later. 

Then would I need to define the pikaday github url in this format?

{    "plugin" :{     

   "url": 

"https://github.com/Pikaday/Pikaday"

    }

}

Hi Penny!

No need to do so since you're using Web.
Did that JSON 5 not defined error go away?

Kind regards,
Joseph Enriquez

Still no Luck Sir Joseph

Additionally when patching common_plugin I noticed it was for mobile version. Was wondering if there is a common_plugin for web. I cannot seem to install all components of common_plugin.


Hi Penny!

From your reply
"Additionally when patching common_plugin I noticed it was for mobile version. Was wondering if there is a common_plugin for web. I cannot seem to install all components of common_plugin."

Here's where I got the DatePicker widget I used in the OML that I sent you.

Do we have the same source as your DatePicker widget?

Kind regards,
Joseph Enriquez

Joseph Enriquez wrote:

Hi Penny!

From your reply
"Additionally when patching common_plugin I noticed it was for mobile version. Was wondering if there is a common_plugin for web. I cannot seem to install all components of common_plugin."

Here's where I got the DatePicker widget I used in the OML that I sent you.

Do we have the same source as your DatePicker widget?

Kind regards,
Joseph Enriquez


Sir Joseph, 

it seems that I got the datepicker from the same dependencies. Only thing is the current website is already using SilkUIWeb for other purposes. I dont really know but, is it because of the SilkUIWeb? Like some kind of conflict?

Hi Penny!

I don't have SilkUI as dependency in the DatePicker test app I created in my personal environment.

It is possible that it is the cause of our 'JSON not defined' error.

Have you tried using a DatePicker widget from your environment and then adding the disableWeekends as we did earlier?

Kind regards,
Joseph Enriquez

Hi Penny,

You can use the following to disable weekends in AdvanceFormat,


"{ disableWeekends: true, BeginEmpty: true }"

I tried above and it worked like a charm.