Skip to content

Commit c4f7f4d

Browse files
StartAutomatingStartAutomating
StartAutomating
authored and
StartAutomating
committed
feat: OpenGraph.get_HTML ( Fixes #8 )
Making [DateTime] universal and correctly formatted
1 parent ec13a2f commit c4f7f4d

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

OpenGraph.types.ps1xml

+5-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,11 @@
1919
} else {
2020
foreach ($property in $this.PSObject.Properties) {
2121
if ($property.Name -match ':') {
22-
"<meta property='$($property.Name)' content='$([Web.HttpUtility]::HtmlAttributeEncode($property.Value))' />"
22+
$value = $property.Value
23+
if ($value -is [DateTime]) {
24+
$value = $value.ToUniversalTime().ToString('o')
25+
}
26+
"<meta property='$($property.Name)' content='$([Web.HttpUtility]::HtmlAttributeEncode($value))' />"
2327
}
2428
}
2529
}) -join [Environment]::Newline

0 commit comments

Comments
 (0)