Skip to content

Commit

Permalink
Explicitly coerce TargetPublishDate into ISO8601 prior to use in json (
Browse files Browse the repository at this point in the history
…#180)

The `targetPublishDate` value was getting incorrectly converted to json when generating the config file.

Resolves #179
  • Loading branch information
riverar committed Aug 27, 2020
1 parent 49e289e commit 658cba6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions StoreBroker/PackageTool.ps1
Expand Up @@ -112,7 +112,7 @@ function Get-StoreBrokerConfigFileContentForIapId

# PUBLISH MODE AND VISIBILITY
$updated = $updated -replace '"targetPublishMode": ".*",', "`"targetPublishMode`": `"$($sub.targetPublishMode)`","
$updated = $updated -replace '"targetPublishDate": .*,', "`"targetPublishDate`": `"$($sub.targetPublishDate)`","
$updated = $updated -replace '"targetPublishDate": .*,', "`"targetPublishDate`": `"$(Get-Date -Date $sub.targetPublishDate -Format o | ConvertTo-Json)`","
$updated = $updated -replace '"visibility": ".*",', "`"visibility`": `"$($sub.visibility)`","

# PRICING AND AVAILABILITY
Expand Down Expand Up @@ -284,7 +284,7 @@ function Get-StoreBrokerConfigFileContentForAppId

# PUBLISH MODE AND VISIBILITY
$updated = $updated -replace '"targetPublishMode": ".*",', "`"targetPublishMode`": $($sub.targetPublishMode | ConvertTo-Json),"
$updated = $updated -replace '"targetPublishDate": .*,', "`"targetPublishDate`": $($sub.targetPublishDate | ConvertTo-Json),"
$updated = $updated -replace '"targetPublishDate": .*,', "`"targetPublishDate`": $(Get-Date -Date $sub.targetPublishDate -Format o | ConvertTo-Json),"
$updated = $updated -replace '"visibility": ".*",', "`"visibility`": $($sub.visibility | ConvertTo-Json),"

# PRICING AND AVAILABILITY
Expand Down

0 comments on commit 658cba6

Please sign in to comment.