diff --git a/src/js/PropertyDefinitions/TimeZonePropertyDefinition.ts b/src/js/PropertyDefinitions/TimeZonePropertyDefinition.ts index 5aca7bb7..2074d166 100644 --- a/src/js/PropertyDefinitions/TimeZonePropertyDefinition.ts +++ b/src/js/PropertyDefinitions/TimeZonePropertyDefinition.ts @@ -67,7 +67,12 @@ export class TimeZonePropertyDefinition extends PropertyDefinition { if (!writer.IsTimeZoneHeaderEmitted || value != writer.Service.TimeZone) { let timeZoneDefinition: TimeZoneDefinition = new TimeZoneDefinition(value); - timeZoneDefinition.WriteToXml(writer); + //Use the actual xmlElementName of this property definition, as it may have different names depending on the context + // e.g. StartTimeZone, EndTimeZone + writer.WriteStartElement(timeZoneDefinition.Namespace, this.XmlElementName); + timeZoneDefinition.WriteAttributesToXml(writer); + timeZoneDefinition.WriteElementsToXml(writer); + writer.WriteEndElement(); } } }