-
-
Notifications
You must be signed in to change notification settings - Fork 115
fix(tables): update ColumnHighlighter + add DateTime example #514
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
6f5492a
f4fbe7f
07b3753
82022f2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,31 @@ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Import-Module .\PSWriteHTML.psd1 -Force | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Demonstrates date comparisons with formats commonly used in PowerShell/.NET output, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # and verifies both HTML and JavaScript DataStore modes. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| $DateDeleteCheck = Get-Date -Year 2025 -Month 1 -Day 5 -Hour 0 -Minute 0 -Second 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| $AdminsDisabled = @( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| [pscustomobject]@{ User = 'Before threshold'; RefreshTokenDate = $DateDeleteCheck.AddDays(-1) } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| [pscustomobject]@{ User = 'Equal to threshold'; RefreshTokenDate = $DateDeleteCheck } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| [pscustomobject]@{ User = 'After threshold'; RefreshTokenDate = $DateDeleteCheck.AddDays(1) } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| [pscustomobject]@{ User = 'Empty / null'; RefreshTokenDate = $null } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| New-HTML { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| New-HTMLSection -HeaderText 'HTML DataStore (dd/MM/yyyy)' { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| New-HTMLTableOption -DataStore HTML -DateTimeFormat 'dd/MM/yyyy HH:mm:ss' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| New-HTMLTable -DataTable $AdminsDisabled -HideFooter -DisablePaging -DateTimeSortingFormat 'DD/MM/YYYY HH:mm:ss' { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| New-HTMLTableHeader -Title 'HTML: Highlight RefreshTokenDate < threshold' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 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' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| New-HTMLSection -HeaderText 'JavaScript DataStore (dd/MM/yyyy)' { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| New-HTMLTableOption -DataStore JavaScript -DateTimeFormat 'dd/MM/yyyy HH:mm:ss' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| New-HTMLTable -DataTable $AdminsDisabled -HideFooter -DisablePaging -DateTimeSortingFormat 'DD/MM/YYYY HH:mm:ss' { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| New-HTMLTableHeader -Title 'JavaScript: Highlight RefreshTokenDate < threshold' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 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' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+16
to
+28
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| New-HTMLSection -HeaderText 'HTML DataStore (dd/MM/yyyy)' { | |
| New-HTMLTableOption -DataStore HTML -DateTimeFormat 'dd/MM/yyyy HH:mm:ss' | |
| New-HTMLTable -DataTable $AdminsDisabled -HideFooter -DisablePaging -DateTimeSortingFormat 'DD/MM/YYYY HH:mm:ss' { | |
| New-HTMLTableHeader -Title 'HTML: Highlight RefreshTokenDate < threshold' | |
| 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' | |
| } | |
| } | |
| New-HTMLSection -HeaderText 'JavaScript DataStore (dd/MM/yyyy)' { | |
| New-HTMLTableOption -DataStore JavaScript -DateTimeFormat 'dd/MM/yyyy HH:mm:ss' | |
| New-HTMLTable -DataTable $AdminsDisabled -HideFooter -DisablePaging -DateTimeSortingFormat 'DD/MM/YYYY HH:mm:ss' { | |
| New-HTMLTableHeader -Title 'JavaScript: Highlight RefreshTokenDate < threshold' | |
| 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' | |
| New-HTMLSection -HeaderText 'HTML DataStore (DD/MM/YYYY)' { | |
| New-HTMLTableOption -DataStore HTML -DateTimeFormat 'DD/MM/YYYY HH:mm:ss' | |
| New-HTMLTable -DataTable $AdminsDisabled -HideFooter -DisablePaging -DateTimeSortingFormat 'DD/MM/YYYY HH:mm:ss' { | |
| New-HTMLTableHeader -Title 'HTML: Highlight RefreshTokenDate < threshold' | |
| 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' | |
| } | |
| } | |
| New-HTMLSection -HeaderText 'JavaScript DataStore (DD/MM/YYYY)' { | |
| New-HTMLTableOption -DataStore JavaScript -DateTimeFormat 'DD/MM/YYYY HH:mm:ss' | |
| New-HTMLTable -DataTable $AdminsDisabled -HideFooter -DisablePaging -DateTimeSortingFormat 'DD/MM/YYYY HH:mm:ss' { | |
| New-HTMLTableHeader -Title 'JavaScript: Highlight RefreshTokenDate < threshold' | |
| 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' |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -962,7 +962,7 @@ | |
| Comment = 'DataTables Conditions' | ||
| Header = @{ | ||
| JsLink = @( | ||
| "https://cdn.jsdelivr.net/npm/@evotecit/[email protected].2/dist/datatables.columnHighlighter.js" | ||
| "https://cdn.jsdelivr.net/npm/@evotecit/[email protected].12/dist/datatables.columnHighlighter.js" | ||
| ) | ||
| JS = @( | ||
| "$PSScriptRoot\..\Resources\JS\dataTables.columnHighlighter.js" | ||
|
|
@@ -2202,4 +2202,4 @@ | |
| # 'Mermaid' | ||
| # ) | ||
| # Import-Module "C:\Support\GitHub\PSWriteHTML.Helper\PSWriteHTML.Helper.psd1" -Force | ||
| # Save-HTMLResource -Configuration $Configuration -Keys $Keys -PathToSave 'C:\Support\GitHub\PSWriteHTML\Resources\CSS' -Verbose | ||
| # Save-HTMLResource -Configuration $Configuration -Keys $Keys -PathToSave 'C:\Support\GitHub\PSWriteHTML\Resources\CSS' -Verbose | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same inconsistency in date format case conventions as lines 17-20. The New-HTMLTableOption uses lowercase tokens (dd/MM/yyyy) while New-HTMLTable and New-HTMLTableCondition use uppercase tokens (DD/MM/YYYY). Consider standardizing on one convention for clarity.