Skip to content

Commit

Permalink
Apply ParameterDateFormat to date in header as well
Browse files Browse the repository at this point in the history
  • Loading branch information
Elzo Lubbers committed Feb 5, 2024
1 parent 116c636 commit fcd15c4
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
{% if parameter.IsStringArray -%}
request_.Headers.TryAddWithoutValidation("{{ parameter.Name }}", {{ parameter.VariableName }});
{% elsif parameter.IsDateTime -%}
request_.Headers.TryAddWithoutValidation("{{ parameter.Name }}", ConvertToString({{ parameter.VariableName }}{% if parameter.IsNullable %}?{% endif %}.ToString("{{ ParameterDateTimeFormat }}"), System.Globalization.CultureInfo.InvariantCulture));
request_.Headers.TryAddWithoutValidation("{{ parameter.Name }}", ConvertToString({{ parameter.VariableName }}{% if parameter.IsNullable or parameter.IsSystemNullable %}?{% endif %}.ToString("{{ ParameterDateTimeFormat }}"), System.Globalization.CultureInfo.InvariantCulture));
{% elsif parameter.IsDate -%}
request_.Headers.TryAddWithoutValidation("{{ parameter.Name }}", ConvertToString({{ parameter.VariableName }}{% if parameter.IsNullable or parameter.IsSystemNullable %}?{% endif %}.ToString("{{ ParameterDateFormat }}"), System.Globalization.CultureInfo.InvariantCulture));
{% else -%}
request_.Headers.TryAddWithoutValidation("{{ parameter.Name }}", ConvertToString({{ parameter.VariableName }}, System.Globalization.CultureInfo.InvariantCulture));
{%- endif %}

0 comments on commit fcd15c4

Please sign in to comment.