@@ -135,6 +135,11 @@ impl SchemaType<'_> {
135135 ) ;
136136 }
137137
138+ #[ cfg( feature = "jiff_0_2" ) ]
139+ if !primitive {
140+ primitive = matches ! ( name, "Zoned" | "Date" ) ;
141+ }
142+
138143 primitive
139144 }
140145 }
@@ -268,7 +273,7 @@ impl ToTokensDiagnostics for SchemaType<'_> {
268273 schema_type_tokens ( tokens, SchemaTypeInner :: String , self . nullable )
269274 }
270275
271- #[ cfg( any( feature = "chrono" , feature = "time" ) ) ]
276+ #[ cfg( any( feature = "chrono" , feature = "time" , feature = "jiff_0_2" ) ) ]
272277 "Date" | "Duration" => {
273278 schema_type_tokens ( tokens, SchemaTypeInner :: String , self . nullable )
274279 }
@@ -295,6 +300,8 @@ impl ToTokensDiagnostics for SchemaType<'_> {
295300 "PrimitiveDateTime" | "OffsetDateTime" => {
296301 schema_type_tokens ( tokens, SchemaTypeInner :: String , self . nullable )
297302 }
303+ #[ cfg( feature = "jiff_0_2" ) ]
304+ "Zoned" => schema_type_tokens ( tokens, SchemaTypeInner :: String , self . nullable ) ,
298305 _ => schema_type_tokens ( tokens, SchemaTypeInner :: Object , self . nullable ) ,
299306 } ;
300307
@@ -399,7 +406,7 @@ impl KnownFormat {
399406 #[ cfg( feature = "chrono" ) ]
400407 "DateTime" | "NaiveDateTime" => Self :: DateTime ,
401408
402- #[ cfg( any( feature = "chrono" , feature = "time" ) ) ]
409+ #[ cfg( any( feature = "chrono" , feature = "time" , feature = "jiff_0_2" ) ) ]
403410 "Date" => Self :: Date ,
404411
405412 #[ cfg( feature = "decimal_float" ) ]
@@ -416,6 +423,9 @@ impl KnownFormat {
416423
417424 #[ cfg( feature = "time" ) ]
418425 "PrimitiveDateTime" | "OffsetDateTime" => Self :: DateTime ,
426+
427+ #[ cfg( feature = "jiff_0_2" ) ]
428+ "Zoned" => Self :: DateTime ,
419429 _ => Self :: Unknown ,
420430 } ;
421431
@@ -694,8 +704,13 @@ impl PrimitiveType {
694704 syn:: parse_quote!( String )
695705 }
696706
707+ #[ cfg( any( feature = "chrono" , feature = "time" , feature = "jiff_0_2" ) ) ]
708+ "Date" => {
709+ syn:: parse_quote!( String )
710+ }
711+
697712 #[ cfg( any( feature = "chrono" , feature = "time" ) ) ]
698- "Date" | " Duration" => {
713+ "Duration" => {
699714 syn:: parse_quote!( String )
700715 }
701716
@@ -733,6 +748,11 @@ impl PrimitiveType {
733748 "PrimitiveDateTime" | "OffsetDateTime" => {
734749 syn:: parse_quote!( String )
735750 }
751+
752+ #[ cfg( feature = "jiff_0_2" ) ]
753+ "Zoned" => {
754+ syn:: parse_quote!( String )
755+ }
736756 _ => {
737757 // not a primitive type
738758 return None ;
0 commit comments