diff --git a/src/date.rs b/src/date.rs index f50a1c4f..73dd3bd7 100644 --- a/src/date.rs +++ b/src/date.rs @@ -16,14 +16,17 @@ use std::str::FromStr; pub struct DateTime(ChronoDateTime); impl DateTime { + /// Retrieves the associated timezone. pub fn timezone(&self) -> FixedOffset { self.0.timezone() } + /// Returns a new `DateTime` with a different timezone. pub fn with_timezone(&self, tz: &FixedOffset) -> DateTime { DateTime(self.0.with_timezone(tz)) } + /// Formats this `DateTime` with the specified format string. pub fn format(&self, fmt: &str) -> String { format!("{}", self.0.format(fmt)) } diff --git a/src/time.rs b/src/time.rs index c1073938..91866660 100644 --- a/src/time.rs +++ b/src/time.rs @@ -14,11 +14,13 @@ use std::convert::TryFrom; use std::str::FromStr; generate_empty_element!( + /// An entity time query. TimeQuery, "time", TIME ); impl IqGetPayload for TimeQuery {} +/// An entity time result, containing an unique DateTime. #[derive(Debug, Clone)] pub struct TimeResult(pub DateTime);