@@ -16,9 +16,6 @@ use crate::base::TCFType;
16
16
use crate :: date:: { CFDate , CFTimeInterval } ;
17
17
use crate :: string:: CFString ;
18
18
19
- #[ cfg( feature = "with-chrono" ) ]
20
- use chrono:: { FixedOffset , NaiveDateTime } ;
21
-
22
19
declare_TCFType ! {
23
20
/// A time zone.
24
21
CFTimeZone , CFTimeZoneRef
@@ -56,17 +53,6 @@ impl CFTimeZone {
56
53
unsafe { CFTimeZoneGetSecondsFromGMT ( self . 0 , date. abs_time ( ) ) }
57
54
}
58
55
59
- #[ cfg( feature = "with-chrono" ) ]
60
- pub fn offset_at_date ( & self , date : NaiveDateTime ) -> FixedOffset {
61
- let date = CFDate :: from_naive_utc ( date) ;
62
- FixedOffset :: east ( self . seconds_from_gmt ( date) as i32 )
63
- }
64
-
65
- #[ cfg( feature = "with-chrono" ) ]
66
- pub fn from_offset ( offset : FixedOffset ) -> CFTimeZone {
67
- CFTimeZone :: new ( offset. local_minus_utc ( ) as f64 )
68
- }
69
-
70
56
/// The timezone database ID that identifies the time zone. E.g. `"America/Los_Angeles" `or
71
57
/// `"Europe/Paris"`.
72
58
pub fn name ( & self ) -> CFString {
@@ -78,22 +64,10 @@ impl CFTimeZone {
78
64
mod test {
79
65
use super :: CFTimeZone ;
80
66
81
- #[ cfg( feature = "with-chrono" ) ]
82
- use chrono:: { FixedOffset , NaiveDateTime } ;
83
-
84
67
#[ test]
85
68
fn timezone_comparison ( ) {
86
69
let system = CFTimeZone :: system ( ) ;
87
70
let default = CFTimeZone :: default ( ) ;
88
71
assert_eq ! ( system, default ) ;
89
72
}
90
-
91
- #[ test]
92
- #[ cfg( feature = "with-chrono" ) ]
93
- fn timezone_chrono_conversion ( ) {
94
- let offset = FixedOffset :: west ( 28800 ) ;
95
- let tz = CFTimeZone :: from_offset ( offset) ;
96
- let converted = tz. offset_at_date ( NaiveDateTime :: from_timestamp ( 0 , 0 ) ) ;
97
- assert_eq ! ( offset, converted) ;
98
- }
99
73
}
0 commit comments