Highlighted
Outstanding Contributor.
Outstanding Contributor.
1350 views

Work with a CALENDAR in WPF

Jump to solution

Hello,

I need to use a calendar and I can not set the following functions (in Cobol code):
- BlackoutDates = I used the command "invoke CalSaida::BlackoutDates::Add (new CalendarDateRange (new DateTime (01/01/2016), new DateTime (04/28/2016)))"
but gives nothing
What I want is to block the calendar as of yesterday.

- Selectdates (SelectionMode = "SingleRange") = I used the command "set wrk-reser to CalEntrada::SelectedDates" where wrk-reser is a "SelectedDatesCollection".
The variable-wrk reser has the start date and end date but I can not get.

I ask again for your help.

Thanks

0 Likes
1 Solution

Accepted Solutions
Highlighted
Micro Focus Expert
Micro Focus Expert

RE: Work with a CALENDAR in WPF

Jump to solution

Something like this would work:

       01 StartDate.
          05 StartYear  pic 9(4)  value 2016.
          05 StartMonth pic 9(2)  value 05.
          05 StartDay   pic 9(2)  value 15.
       01 EndDate.
          05 EndYear  pic 9(4)  value 2016.
          05 EndMonth pic 9(2)  value 05.
          05 EndDay   pic 9(2)  value 20.
          
       
           declare myrange as type CalendarDateRange = New CalendarDateRange(new DateTime(StartYear, StartMonth, StartDay), new type DateTime(EndYear, EndMonth, EndDay))
           invoke myCalendar::BlackoutDates::Add(myRange)
       end method.

View solution in original post

0 Likes
3 Replies
Highlighted
Outstanding Contributor.
Outstanding Contributor.

RE: Work with a CALENDAR in WPF

Jump to solution

Hello,

I've got for the command to work: "invoke CalSaida::BlackoutDates::Add(new CalendarDateRange(new DateTime(2016,05,15); new DateTime(2016,05,20)))"

My problem now is to replace the constants (2016,05,15) by a variable as it has to be dynamic.

Thanks

Best Regards

Alberto Ferraz

0 Likes
Highlighted
Micro Focus Expert
Micro Focus Expert

RE: Work with a CALENDAR in WPF

Jump to solution

Something like this would work:

       01 StartDate.
          05 StartYear  pic 9(4)  value 2016.
          05 StartMonth pic 9(2)  value 05.
          05 StartDay   pic 9(2)  value 15.
       01 EndDate.
          05 EndYear  pic 9(4)  value 2016.
          05 EndMonth pic 9(2)  value 05.
          05 EndDay   pic 9(2)  value 20.
          
       
           declare myrange as type CalendarDateRange = New CalendarDateRange(new DateTime(StartYear, StartMonth, StartDay), new type DateTime(EndYear, EndMonth, EndDay))
           invoke myCalendar::BlackoutDates::Add(myRange)
       end method.

View solution in original post

0 Likes
Highlighted
Outstanding Contributor.
Outstanding Contributor.

RE: Work with a CALENDAR in WPF

Jump to solution

Hi Chris,

Thanks again for your solution. It wroks good.

Best regards

Alberto Ferraz

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.