• MonthCalendar and current month

    From Grzegorz R.@21:1/5 to All on Tue Mar 23 10:00:23 2021
    Hello
    I use MonthCalendar instead of RighSLE because MC has week numbers (what RSLE does not) so I would like to stick with that.
    I have MC streched vertically to have 3 months at once.
    My problem is that the top month is NOT the current one of selected or current date - for example today (23/03) it shows Jan-Mar instead of Mar-May.
    Surprisingly at design (editor) it works/shows fine.
    Is there a way to force MC to start with month of selected/given date? Greetings
    Gregory

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From D.J.W. van Kooten@21:1/5 to All on Wed Mar 24 11:47:02 2021
    Replying on message of Tue, 23 Mar 2021 10:00:23 -0700 (PDT) from
    Grzegorz R.:


    Hello Grzegorz R.

    I have MC streched vertically to have 3 months at once.
    My problem is that the top month is NOT the current one of selected or current date - for example today (23/03) it shows Jan-Mar instead of Mar-May.
    Surprisingly at design (editor) it works/shows fine.
    Is there a way to force MC to start with month of selected/given date?

    Hello Gregory,

    I am not sure what you are doing, I'll explain what I am doing:

    I have a datawindow on which I have 12 month calendar controls (3 rows
    of 4) so a user can set days off for employees by directly selecting
    one or more dates.

    In the design mode it now shows March 2021 for every of the 12 month
    calendars (as it is now Match 2021) .

    Then, on postinit, I call a method to determine what I want to see as
    first month (which is the previous month) in the first monthcalendar
    (mc1) and after that I set all the other controls (mc2-mc12) as well,
    like this:


    LOCAL oDR AS DateRange
    LOCAL dDatum AS DATE


    dDatum:=BoM(dStart-35) // Begin at last month
    oDR:=DateRange{dDatum,dDatum+1} // set 1 day range for next
    control
    SELF:oDCmc1:Selectionrange:=oDR // set date range to this day

    (//set dDatum to next month and then):
    SELF:oDCmc2:Selectionrange:=oDR // set date range to this day

    etc for all controls mc1-mc12

    Does this help?

    Dick

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Grzegorz R.@21:1/5 to All on Thu Apr 1 09:03:50 2021
    środa, 24 marca 2021 o 11:47:02 UTC+1 D.J.W. van Kooten napisał(a):
    Replying on message of Tue, 23 Mar 2021 10:00:23 -0700 (PDT) from
    Grzegorz R.:


    Hello Grzegorz R.
    I have MC streched vertically to have 3 months at once.
    My problem is that the top month is NOT the current one of selected or current date - for example today (23/03) it shows Jan-Mar instead of Mar-May.
    Surprisingly at design (editor) it works/shows fine.
    Is there a way to force MC to start with month of selected/given date?
    Hello Gregory,

    I am not sure what you are doing, I'll explain what I am doing:

    I have a datawindow on which I have 12 month calendar controls (3 rows
    of 4) so a user can set days off for employees by directly selecting
    one or more dates.

    In the design mode it now shows March 2021 for every of the 12 month calendars (as it is now Match 2021) .

    Then, on postinit, I call a method to determine what I want to see as
    first month (which is the previous month) in the first monthcalendar
    (mc1) and after that I set all the other controls (mc2-mc12) as well,
    like this:


    LOCAL oDR AS DateRange
    LOCAL dDatum AS DATE


    dDatum:=BoM(dStart-35) // Begin at last month oDR:=DateRange{dDatum,dDatum+1} // set 1 day range for next
    control
    SELF:oDCmc1:Selectionrange:=oDR // set date range to this day

    (//set dDatum to next month and then):
    SELF:oDCmc2:Selectionrange:=oDR // set date range to this day

    etc for all controls mc1-mc12

    Does this help?

    Dick
    Hello Dick
    sorry to be quiet a while...

    First - I do not understand why You use 12 separate month calendar controls instead of use one streched (if You strech MC horizontal and/or vertical You will se more that one month - I'm pretty sure You know that). Using 12 controls sounds quite
    complicated to me instead of one.

    Second - I do not want to restrict date range but just position a 3-month control so that current -1 month is the first one. In march I saw Jan-Mar range and now I see Apr-Jun but want at any time to see M-1 to M+1 to current date.
    I'm not able to achieve that...

    Hope that helps to help but can also put somewhere snapshots what I mean if Yo like...

    Kind regards
    Gregory

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From D.J.W. van Kooten@21:1/5 to All on Wed Apr 7 12:07:37 2021
    Replying on message of Thu, 1 Apr 2021 09:03:50 -0700 (PDT) from
    Grzegorz R.:


    Hello Grzegorz,

    First - I do not understand why You use 12 separate month calendar controls instead of use one streched (if You strech MC horizontal and/or vertical You will se more that one month - I'm pretty sure You know that). Using 12 controls sounds quite
    complicated to me instead of one.

    Second - I do not want to restrict date range but just position a 3-month control so that current -1 month is the first one. In march I saw Jan-Mar range and now I see Apr-Jun but want at any time to see M-1 to M+1 to current date.
    I'm not able to achieve that...


    It is well possible that I didn't know that when I wrote this long
    ago:)

    Could it be that your range problem exists because you use one
    stretched control, as I don't have that problem with the code I
    provided in my previous answer using 12 separate controls?

    Dick

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)