Skip to content

Commit

Permalink
Fixed preserving correct start time
Browse files Browse the repository at this point in the history
  • Loading branch information
chris-w-dev committed Jul 8, 2023
1 parent 1be03dc commit 8af4677
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions LogicAppTemplate/TemplateGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -917,10 +917,10 @@ private JToken handleActions(JObject definition, JObject parameters)
if (ShouldAddTemplateParameter(recurrence["startTime"]))
{
string value = recurrence.Value<string>("startTime");
DateTime date;
if (DateTime.TryParse(value, out date))
if (recurrence["startTime"].Type == JTokenType.Date)
{
value = date.ToString("O");
// preserve start time exactly as specified if it is a date
value = recurrence["startTime"].ToString(Formatting.None).Replace("\"", string.Empty);
}
definition["triggers"][trigger.Name]["recurrence"]["startTime"] = "[parameters('" + this.AddTemplateParameter(trigger.Name + "StartTime", "string", value) + "')]";
}
Expand Down

0 comments on commit 8af4677

Please # to comment.