CALENDAR_SetSel() - messes with days of the week

This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

  • CALENDAR_SetSel() - messes with days of the week

    Hi,

    I've noticed some odd behaviour when calling the CALENDAR_SetSel() function. It appears to alter the days of the week on the calendar.

    For example, I am implementing a function which does not allow the user to select a date before 2015.
    The calendar is initialised with today's date (Tuesday 18th August 2015). If a user selects a date before 1st January 2015, an error message is displayed and the selected date is reset to today's date (using CALENDAR_SetSel).
    CALENDAR_SetSel does reset the date correctly but the calendar now shows Friday 18th August 2015 - not Tuesday.



    Is this a known bug? Is there a way around it?

    Here's a snippet of the code used to determine the date and reset it if it is before 2015:

    C Source Code

    1. case WM_NOTIFICATION_SEL_CHANGED:
    2. if(hWidgetID == ID_CALENDAR_SETDATE)
    3. {
    4. CALENDAR_DATE tmpDate;
    5. CALENDAR_GetSel(hItem, &tmpDate);
    6. if(tmpDate.Year < 2015)
    7. {
    8. CALENDAR_GetDate(hItem, &tmpDate);
    9. CALENDAR_SetSel(hItem, &tmpDate);
    10. // CODE TO DISPLAY ERROR MESSAGE
    11. }
    12. }
    Display All