Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New-GSCalendarEvent creates all day events (ignoring StartDate and EndDate) #392

Open
Hooch76 opened this issue Feb 4, 2025 · 3 comments

Comments

@Hooch76
Copy link

Hooch76 commented Feb 4, 2025

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:

  1. Run the powershell example: New-GSCalendarEvent "Go to the gym" -StartDate (Get-Date "21:00:00") -EndDate (Get-Date "22:00:00")
  2. Examine calendar. It will show an "all day" event:

Image

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.

@Buenno
Copy link

Buenno commented Feb 4, 2025

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.

@Hooch76
Copy link
Author

Hooch76 commented Feb 4, 2025

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,

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.

@Buenno
Copy link

Buenno commented Feb 4, 2025

No problem. I'll discuss the issue with the maintainers as I noticed a number of inconsistencies within this function.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants