Version

0.0.7

Author

Ironman Software

Downloads

1511

Tags

PowerShellUniversal App Calendar

Created

03/20/2024

PowerShell Universal App Calendar

A calendar component for PowerShell Universal Apps.

Installation

You can install this component as a PowerShell module using PowerShellGet or via PowerShell Universal.

Install-Module Universal.Components.Calendar

Usage

Basic

A basic calendar with events.

New-UDCalendar -Events @(
        New-UDCalendarEvent -Title "Run"
        New-UDCalendarEvent -Title "Run" -Start ((Get-Date).AddDays(1)) -AllDay
) 

Min\Max Time

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"

DateClicked

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.

New-UDCalendar -Events @(
        New-UDCalendarEvent -Title "Run"
        New-UDCalendarEvent -Title "Run" -Start ((Get-Date).AddDays(1)) -AllDay
) -DateClicked {
        Show-UDToast $Body
}

EventClicked

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
}

Locale

Localization of the calendar.

New-UDCalendar -Events @(
        New-UDCalendarEvent -Title "Run"
        New-UDCalendarEvent -Title "Run" -Start ((Get-Date).AddDays(1)) -AllDay
) -Locale 'fr'

Custom Event Rendering

Use the -Content parameter of New-UDCalendarEvent to customize the rendering of an event.

New-UDCalendar -Events @(
        New-UDCalendarEvent -Content {
                New-UDAlert -Text 'Swim'
        }
        New-UDCalendarEvent -Title "Run" -Start ((Get-Date).AddDays(1)) -AllDay
) 

Development

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.

Installation Options

Install within the PowerShell Universal v5 admin console. More Info

PowerShell Universal Gallery

Copy and Paste the following command to install this package using Microsoft.PowerShell.PSResourceGet.

PS > Install-PSResource Universal.Components.Calendar

Version History

Version Published
0.0.7 03/20/2024