Data update

This commit is contained in:
Ingy döt Net 2026-02-01 16:33:20 -08:00
parent 5150844a7d
commit 4bb20c9b71
7735 changed files with 38060 additions and 199180 deletions

View file

@ -1 +0,0 @@
2008..2121 | Where-Object { (Get-Date $_-12-25).DayOfWeek -eq "Sunday" }

View file

@ -1,34 +0,0 @@
function Get-ChristmasHoliday
{
[CmdletBinding()]
[OutputType([PSCustomObject])]
Param
(
[Parameter(Mandatory=$false,
ValueFromPipeline=$true,
ValueFromPipelineByPropertyName=$true,
Position=0)]
[ValidateRange(1,9999)]
[int[]]
$Year = (Get-Date).Year
)
Process
{
[datetime]$christmas = Get-Date $Year/12/25
switch ($christmas.DayOfWeek)
{
"Sunday" {[datetime[]]$dates = 1..5 | ForEach-Object {$christmas.AddDays($_)}}
"Monday" {[datetime[]]$dates = $christmas, $christmas.AddDays(1)}
"Saturday" {[datetime[]]$dates = $christmas.AddDays(-2), $christmas.AddDays(-1)}
Default {[datetime[]]$dates = $christmas.AddDays(-1), $christmas}
}
$dates | Group-Object -Property Year |
Select-Object -Property @{Name="Year" ; Expression={$_.Name}},
@{Name="DayOfWeek"; Expression={$christmas.DayOfWeek}},
@{Name="Christmas"; Expression={$christmas.ToString("MM/dd/yyyy")}},
@{Name="DaysOff" ; Expression={$_.Group | ForEach-Object {$_.ToString("MM/dd/yyyy")}}}
}
}

View file

@ -1 +0,0 @@
2008..2121 | Get-ChristmasHoliday | where DayOfWeek -match Su

View file

@ -1 +0,0 @@
Get-ChristmasHoliday -Year (2008..2121 | Get-Random)

View file

@ -1 +0,0 @@
(Get-Date | Get-ChristmasHoliday).DaysOff

View file

@ -1 +0,0 @@
(Get-Date | Get-ChristmasHoliday).DaysOff | Get-Date