@@ -118,6 +118,13 @@ private string GetJsonToObjCExpressionConversion(string expr,OdcmProperty prop)
118118 expr);
119119 }
120120
121+ if(GetObjCTypeIdentifier(prop,true)=="MSDuration")
122+ {
123+ return String.Format(@"[{0} ms_durationFromString: {1}]",
124+ GetObjCTypeIdentifier(prop,true),
125+ expr);
126+ }
127+
121128 if(prop.IsEnum())
122129 {
123130 return String.Format(
@@ -195,6 +202,27 @@ private string SetDictionaryPropertyInJsonConvertibleForm(OdcmProperty prop, str
195202 // Dictionary entries can either be directly NSJSON-typed, or convertible to
196203 // a NSJSON type via [MSObject getNSJsonSerializationCompatibleValue].
197204 //
205+
206+ if(GetObjCTypeIdentifier(prop,true)=="NSDate" ||
207+ GetObjCTypeIdentifier(prop,true)=="MSDate")
208+ {
209+ return String.Format(@"self.dictionary[@""{0}""] = {1};",
210+ prop.Name,
211+ String.Format(@"[{0} ms_toString]",GetObjCToJsonConvertibleExpressionConversion(prop,val)));
212+ }
213+
214+ if(GetObjCTypeIdentifier(prop,true)=="MSTimeOfDay")
215+ {
216+ return String.Format(@"self.dictionary[@""{0}""] = {1};",
217+ prop.Name,
218+ String.Format(@"[{0} ms_toString]",GetObjCToJsonConvertibleExpressionConversion(prop,val)));
219+ }
220+
221+ if(GetObjCTypeIdentifier(prop,true)=="MSDuration")
222+ {
223+ return String.Format(@"self.dictionary[@""{0}""] = {1};",prop.Name,String.Format(@"{0}.durationString",GetObjCToJsonConvertibleExpressionConversion(prop,val)));
224+ }
225+
198226 return String.Format(@"self.dictionary[@""{0}""] = {1};",prop.Name,GetObjCToJsonConvertibleExpressionConversion(prop,val));
199227}
200228
0 commit comments