Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ All notable changes to PSExchangeClock will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

### Fixed

- Countdowns rounded hours instead of truncating them (e.g. 7h36m displayed as `08:36:00`)

## [1.1.0] - 2026-09-28

### Fixed
Expand Down
10 changes: 5 additions & 5 deletions PSExchangeClock/Public/New-StockExchangeCountdownDashboard.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ public static class CredManager {
# Pre-market
if ($localNow -lt $openTime) {
$remaining = $openTime - $localNow
return @{ Status = 'PreMarket'; Text = "Opens in $("{0:D2}:{1:D2}:{2:D2}" -f [int]$remaining.TotalHours, $remaining.Minutes, $remaining.Seconds)"; TimeRemaining = $remaining; CountdownTarget = 'Open' }
return @{ Status = 'PreMarket'; Text = "Opens in $("{0:D2}:{1:D2}:{2:D2}" -f [int][math]::Floor($remaining.TotalHours), $remaining.Minutes, $remaining.Seconds)"; TimeRemaining = $remaining; CountdownTarget = 'Open' }
}

# Post-close
Expand All @@ -393,12 +393,12 @@ public static class CredManager {
# Lunch break
if ($lunchStart -and $lunchEnd -and $localNow -ge $lunchStart -and $localNow -lt $lunchEnd) {
$remaining = $lunchEnd - $localNow
return @{ Status = 'LunchBreak'; Text = "Lunch - Reopens in $("{0:D2}:{1:D2}:{2:D2}" -f [int]$remaining.TotalHours, $remaining.Minutes, $remaining.Seconds)"; TimeRemaining = $remaining; CountdownTarget = 'Reopen' }
return @{ Status = 'LunchBreak'; Text = "Lunch - Reopens in $("{0:D2}:{1:D2}:{2:D2}" -f [int][math]::Floor($remaining.TotalHours), $remaining.Minutes, $remaining.Seconds)"; TimeRemaining = $remaining; CountdownTarget = 'Reopen' }
}

# Open — countdown to close (skip lunch if applicable)
$remaining = $closeTime - $localNow
$countdownStr = "{0:D2}:{1:D2}:{2:D2}" -f [int]$remaining.TotalHours, $remaining.Minutes, $remaining.Seconds
$countdownStr = "{0:D2}:{1:D2}:{2:D2}" -f [int][math]::Floor($remaining.TotalHours), $remaining.Minutes, $remaining.Seconds

if ($remaining.TotalMinutes -le 5) {
return @{ Status = 'ClosingImminent'; Text = "Closes in $countdownStr"; TimeRemaining = $remaining; CountdownTarget = 'Close' }
Expand Down Expand Up @@ -4545,7 +4545,7 @@ public static class CredManager {
$row.StatusColor = $color

if ($statusInfo.TimeRemaining) {
$row.CountdownText = "{0:D2}:{1:D2}:{2:D2}" -f [int]$statusInfo.TimeRemaining.TotalHours, $statusInfo.TimeRemaining.Minutes, $statusInfo.TimeRemaining.Seconds
$row.CountdownText = "{0:D2}:{1:D2}:{2:D2}" -f [int][math]::Floor($statusInfo.TimeRemaining.TotalHours), $statusInfo.TimeRemaining.Minutes, $statusInfo.TimeRemaining.Seconds
}
else {
$row.CountdownText = '--:--:--'
Expand Down Expand Up @@ -4611,7 +4611,7 @@ public static class CredManager {

# Update status bar
if ($nextCloseExchange -and $nextCloseRemaining) {
$ncs = "{0:D2}:{1:D2}:{2:D2}" -f [int]$nextCloseRemaining.TotalHours, $nextCloseRemaining.Minutes, $nextCloseRemaining.Seconds
$ncs = "{0:D2}:{1:D2}:{2:D2}" -f [int][math]::Floor($nextCloseRemaining.TotalHours), $nextCloseRemaining.Minutes, $nextCloseRemaining.Seconds
$txtNextClose.Text = "Next close: $nextCloseExchange in $ncs"
$window.Title = "PSExchangeClock — Next: $nextCloseExchange $ncs"
}
Expand Down