Skip to content

Commit bc4bfb6

Browse files
Merge pull request #514 from EvotecIT/fix/htmlextensions-columnhighlighter-v0.1.10
2 parents 9e9e64d + 82022f2 commit bc4bfb6

File tree

3 files changed

+458
-34
lines changed

3 files changed

+458
-34
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
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

Private/Parameters.Configuration.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -962,7 +962,7 @@
962962
Comment = 'DataTables Conditions'
963963
Header = @{
964964
JsLink = @(
965-
"https://cdn.jsdelivr.net/npm/@evotecit/[email protected].2/dist/datatables.columnHighlighter.js"
965+
"https://cdn.jsdelivr.net/npm/@evotecit/[email protected].12/dist/datatables.columnHighlighter.js"
966966
)
967967
JS = @(
968968
"$PSScriptRoot\..\Resources\JS\dataTables.columnHighlighter.js"
@@ -2202,4 +2202,4 @@
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

0 commit comments

Comments
 (0)