From c16b860f357a43a43746e0dd05f50e7775bd8a4d Mon Sep 17 00:00:00 2001 From: deadlydog Date: Mon, 20 May 2024 16:06:43 -0600 Subject: [PATCH 1/2] fix: Write time using round-trip format instead of OS-specific format to avoid parse errors Fixes Bug #60 --- src/tiPS/Private/AutomaticModuleUpdateFunctions.ps1 | 2 +- src/tiPS/Private/AutomaticWritePowerShellTipFunctions.ps1 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tiPS/Private/AutomaticModuleUpdateFunctions.ps1 b/src/tiPS/Private/AutomaticModuleUpdateFunctions.ps1 index 903accd..fde01f2 100644 --- a/src/tiPS/Private/AutomaticModuleUpdateFunctions.ps1 +++ b/src/tiPS/Private/AutomaticModuleUpdateFunctions.ps1 @@ -90,7 +90,7 @@ function WriteModulesLastUpdateDate [string] $moduleUpdateDateFilePath = GetModulesLastUpdateDateFilePath Write-Verbose "Writing modules last update date '$ModulesLastUpdateDate' to '$moduleUpdateDateFilePath'." - [System.IO.File]::WriteAllText($moduleUpdateDateFilePath, $ModulesLastUpdateDate.ToString()) + [System.IO.File]::WriteAllText($moduleUpdateDateFilePath, $ModulesLastUpdateDate.ToString('o')) } function GetModulesLastUpdateDateFilePath diff --git a/src/tiPS/Private/AutomaticWritePowerShellTipFunctions.ps1 b/src/tiPS/Private/AutomaticWritePowerShellTipFunctions.ps1 index e681859..aa0e1c8 100644 --- a/src/tiPS/Private/AutomaticWritePowerShellTipFunctions.ps1 +++ b/src/tiPS/Private/AutomaticWritePowerShellTipFunctions.ps1 @@ -122,7 +122,7 @@ function WriteLastAutomaticTipWrittenDate [string] $lastAutomaticTipWrittenDateFilePath = GetLastAutomaticTipWrittenDateFilePath Write-Verbose "Writing last automatic tip Written date '$LastAutomaticTipWrittenDate' to '$lastAutomaticTipWrittenDateFilePath'." - [System.IO.File]::WriteAllText($lastAutomaticTipWrittenDateFilePath, $LastAutomaticTipWrittenDate.ToString()) + [System.IO.File]::WriteAllText($lastAutomaticTipWrittenDateFilePath, $LastAutomaticTipWrittenDate.ToString('o')) } function GetLastAutomaticTipWrittenDateFilePath From ce4916f6508aff6d61cc530310284dc121f957ac Mon Sep 17 00:00:00 2001 From: deadlydog Date: Mon, 20 May 2024 16:14:52 -0600 Subject: [PATCH 2/2] docs: Update changelog with fix --- Changelog.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Changelog.md b/Changelog.md index b61c8f7..11f3662 100644 --- a/Changelog.md +++ b/Changelog.md @@ -3,6 +3,12 @@ This page is a list of _notable_ changes made in each version. Every time a tip is added the patch version is incremented, so there will be a lot of patch version changes not documented here. +## v1.3.7 - May 20, 2024 + +Fixes: + +- Write module's last auto-update time and last auto-write tip time to file using a universal format instead of an OS-dependent format to avoid errors parsing the datetime when the module loads. + ## v1.3.0 - April 20, 2024 Features: