Skip to content

Commit

Permalink
Publish-GitPubJekyll: Fixing date handling (Fixes #51)
Browse files Browse the repository at this point in the history
  • Loading branch information
StartAutomating authored and StartAutomating committed Oct 25, 2022
1 parent e39a8d3 commit eb68559
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Publish-GitPubJekyll.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -182,10 +182,14 @@ permalink: /$Year/$Month/$Day/
$outputParentPath = Split-Path $OutputPath
$summaryFiles = @{}
foreach ($postFound in $foundPosts) {
$postFoundDate = $postFound.Name.Substring(0,10) -as [DateTime]
$postFoundDate = (@($postFound.Name -split '-',4)[0..3] -join '-') -as [DateTime]
if (-not $postFoundDate) {
continue
}
$year = $postFoundDate.ToString("yyyy")
$month = $postFoundDate.ToString("MM")
$day = $postFoundDate.ToString("dd")

foreach ($summaryName in 'Yearly','Monthly','Daily') {
$summaryContent = $ExecutionContext.SessionState.PSVariable.Get("${summaryName}Summary").Value
$summaryExtension = $ExecutionContext.SessionState.PSVariable.Get("${summaryName}SummaryExtension").Value.ToLower()
Expand Down

0 comments on commit eb68559

Please sign in to comment.