New-GSCalendarEvent creates all day events (ignoring StartDate and EndDate)
Describe the bug
The following example ca be found on https://psgsuite.io/Function%20Help/Calendar/New-GSCalendarEvent/#example-1
New-GSCalendarEvent "Go to the gym" -StartDate (Get-Date "21:00:00") -EndDate (Get-Date "22:00:00")
This creates an "all day" event instead of an event starting at 21:00 and ending at 22:00.
To Reproduce Steps to reproduce the behavior:
- Run the powershell example:
New-GSCalendarEvent "Go to the gym" -StartDate (Get-Date "21:00:00") -EndDate (Get-Date "22:00:00") - Examine calendar. It will show an "all day" event:
Expected behavior The event should start and end at the given times. It should not be an all day event.
Screenshots See above at step 2.
Environment (please complete the following information):
- OS: Windows 11 24H2 (10.0.26100.2894)
- PowerShell Version: Windows PowerShell 5.1
- PSGSuite Version: 2.36.4
Additional context Add any other context about the problem here.
I think we would need clarification on how this is intended to work. The examples state that you should be able to set the time, however the code deals only with the date element, not time.
https://github.com/SCRT-HQ/PSGSuite/blob/main/PSGSuite/Public/Calendar/New-GSCalendarEvent.ps1#L301
I believe the examples are incorrect and shouldn't show the use of the time with -StartDate and -EndDate, instead you should be using either -LocalStartDateTime and -LocalEndDateTime, or -UTCStartDateTime and -UTCEndDateTime depending on your desired outcome.
I believe the examples are incorrect and shouldn't show the use of the time with
-StartDateand-EndDate, instead you should be using either-LocalStartDateTimeand-LocalEndDateTime,
Great! It works when using LocalStartDateTime and LocalEndDateTime. I must admit that I haven't even tried those parameters. So it's just the documentation that should be improved. Thanks.
No problem. I'll discuss the issue with the maintainers as I noticed a number of inconsistencies within this function.