InputDate valid dates & TwoDigitYearMax

Posted by: pkim on 30 March 2020, 2:07 am EST

    • Post Options:
    • Link

    Posted 30 March 2020, 2:07 am EST

    Hello,

    I got a couple questions about InputDate:

    1. I’m looking to control how which dates are accepted as valid or invalid (weekends & holidays). From what I’m searching, what I need to use seems to be itemValidator (https://www.grapecity.com/wijmo/docs/Topics/Input/Calendar/Validation), is this correct?

    2. Does wijmo have a built-in option similar to TwoDigitYearMax? I’m basically interested in the same thing from this post (https://www.grapecity.com/forums/wijmo/input-date-controls-and-sh), but the workaround link in there does not work nor I don’t see any updates about this. I see this TwoDigitYearMax property being mentioned in documentation search but it looks to be only for Windows Forms. I can’t find any mention of a similar property from searching api docs on InputDates or Calendar (https://www.grapecity.com/wijmo/api/classes/wijmo_input.inputdate.html). Does a TwoDigitYearMax property not exist for InputDates/Calendars yet?

  • Posted 30 March 2020, 7:42 pm EST

    Hi Paul,

    The itemValidator is the best option for your requirements. There is also a demo for itemValidator that demonstrates this exact behavior:

    https://www.grapecity.com/wijmo/demos/Input/InputDate/Validation/purejs

    Regarding the twoDigitYearMax, this is actually not a property of Calendar class but is based on the culture. This property is available in the culture object of Wijmo and can be changed as per your requirement. Then this will be applied across all the controls:

    
    // year upto 99 will be parsed as 2099
    wijmo.culture.Globalize.calendar.twoDigitYearMax = 2099;
    
    

    I hope this clears your doubts.

    Regards,

    Ashwin

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels