File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ Import-Module .\PSWriteHTML.psd1 - Force
2+
3+ # Demonstrates date comparisons with formats commonly used in PowerShell/.NET output,
4+ # and verifies both HTML and JavaScript DataStore modes.
5+
6+ $DateDeleteCheck = Get-Date - Year 2025 - Month 1 - Day 5 - Hour 0 - Minute 0 - Second 0
7+
8+ $AdminsDisabled = @ (
9+ [pscustomobject ]@ { User = ' Before threshold' ; RefreshTokenDate = $DateDeleteCheck.AddDays (-1 ) }
10+ [pscustomobject ]@ { User = ' Equal to threshold' ; RefreshTokenDate = $DateDeleteCheck }
11+ [pscustomobject ]@ { User = ' After threshold' ; RefreshTokenDate = $DateDeleteCheck.AddDays (1 ) }
12+ [pscustomobject ]@ { User = ' Empty / null' ; RefreshTokenDate = $null }
13+ )
14+
15+ New-HTML {
16+ New-HTMLSection - HeaderText ' HTML DataStore (dd/MM/yyyy)' {
17+ New-HTMLTableOption - DataStore HTML - DateTimeFormat ' dd/MM/yyyy HH:mm:ss'
18+ New-HTMLTable - DataTable $AdminsDisabled - HideFooter - DisablePaging - DateTimeSortingFormat ' DD/MM/YYYY HH:mm:ss' {
19+ New-HTMLTableHeader - Title ' HTML: Highlight RefreshTokenDate < threshold'
20+ New-HTMLTableCondition - Name ' RefreshTokenDate' - ComparisonType ' date' - Operator lt - Value $DateDeleteCheck - BackgroundColor Red - Color Black - FailBackgroundColor LightGreen - FailColor Black - DateTimeFormat ' dd/MM/YYYY HH:mm:ss'
21+ }
22+ }
23+
24+ New-HTMLSection - HeaderText ' JavaScript DataStore (dd/MM/yyyy)' {
25+ New-HTMLTableOption - DataStore JavaScript - DateTimeFormat ' dd/MM/yyyy HH:mm:ss'
26+ New-HTMLTable - DataTable $AdminsDisabled - HideFooter - DisablePaging - DateTimeSortingFormat ' DD/MM/YYYY HH:mm:ss' {
27+ New-HTMLTableHeader - Title ' JavaScript: Highlight RefreshTokenDate < threshold'
28+ New-HTMLTableCondition - Name ' RefreshTokenDate' - ComparisonType ' date' - Operator lt - Value $DateDeleteCheck - BackgroundColor Red - Color Black - FailBackgroundColor LightGreen - FailColor Black - DateTimeFormat ' dd/MM/YYYY HH:mm:ss'
29+ }
30+ }
31+ } - ShowHTML - FilePath $PSScriptRoot \Example- TableDateTimeConditionsFormats.html - Online
Original file line number Diff line number Diff line change 962962 Comment = ' DataTables Conditions'
963963 Header = @ {
964964 JsLink = @ (
965- " https://cdn.jsdelivr.net/npm/@evotecit/htmlextensions@0.1.2 /dist/datatables.columnHighlighter.js"
965+ " https://cdn.jsdelivr.net/npm/@evotecit/htmlextensions@0.1.12 /dist/datatables.columnHighlighter.js"
966966 )
967967 JS = @ (
968968 " $PSScriptRoot \..\Resources\JS\dataTables.columnHighlighter.js"
22022202# 'Mermaid'
22032203# )
22042204# Import-Module "C:\Support\GitHub\PSWriteHTML.Helper\PSWriteHTML.Helper.psd1" -Force
2205- # Save-HTMLResource -Configuration $Configuration -Keys $Keys -PathToSave 'C:\Support\GitHub\PSWriteHTML\Resources\CSS' -Verbose
2205+ # Save-HTMLResource -Configuration $Configuration -Keys $Keys -PathToSave 'C:\Support\GitHub\PSWriteHTML\Resources\CSS' -Verbose
You can’t perform that action at this time.
0 commit comments