Save-Module Universal.Components.Calendar -Path $Env:ProgramData\UniversalAutomation\Repository\Modules
The above command assumes you are running with default settings. You can also install modules from within the PowerShell Universal admin console by clicking Platform \ Modules. Click here for more information about installing PowerShell Universal modules.
0.0.6
Tuesday, 30 May 2023
PowerShellUniversal App Calendar
Ironman Software
A calendar component for PowerShell Universal Apps.
You can install this component as a PowerShell module using PowerShellGet or via PowerShell Universal.
Install-Module Universal.Components.Calendar
A basic calendar with events.
New-UDCalendar -Events @( New-UDCalendarEvent -Title "Run" New-UDCalendarEvent -Title "Run" -Start ((Get-Date).AddDays(1)) -AllDay )
Specify the minimum and maximum time for the calendar.
New-UDCalendar -Events @( New-UDCalendarEvent -Title "Run" New-UDCalendarEvent -Title "Run" -Start ((Get-Date).AddDays(1)) -AllDay ) -View 'timeGridWeek' -SlotMinTime "08:00:00" -SlotMaxTime "19:00:00"
An event handler that is fired when a date is clicked. $Body will contain a JSON string with the date. $EventData will contain an object with the date's properties.
$Body
$EventData
New-UDCalendar -Events @( New-UDCalendarEvent -Title "Run" New-UDCalendarEvent -Title "Run" -Start ((Get-Date).AddDays(1)) -AllDay ) -DateClicked { Show-UDToast $Body }
An event handler that is fired when an event is clicked. $Body will contain a JSON string with the event. $EventData will contain an object with the event's properties.
New-UDCalendar -Events @( New-UDCalendarEvent -Title "Run" New-UDCalendarEvent -Title "Run" -Start ((Get-Date).AddDays(1)) -AllDay ) -EventClicked { Show-UDToast $Body }
Localization of the calendar.
New-UDCalendar -Events @( New-UDCalendarEvent -Title "Run" New-UDCalendarEvent -Title "Run" -Start ((Get-Date).AddDays(1)) -AllDay ) -Locale 'fr'
Use the -Content parameter of New-UDCalendarEvent to customize the rendering of an event.
-Content
New-UDCalendarEvent
New-UDCalendar -Events @( New-UDCalendarEvent -Content { New-UDAlert -Text 'Swim' } New-UDCalendarEvent -Title "Run" -Start ((Get-Date).AddDays(1)) -AllDay )
You will need NodeJS version 16.13.2 and the InvokeBuild module installed to build this module.
You can run Invoke-Build within this directory to build this component.
Invoke-Build
The output will be found within the output folder.