Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/items/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use super::{date, relative, time, weekday, year};
/// date and time using the `set_base()` method before calling `build()`, or
/// leave it unset to use the current date and time as the base.
#[derive(Debug, Default)]
pub struct DateTimeBuilder {
pub(crate) struct DateTimeBuilder {
base: Option<DateTime<FixedOffset>>,
timestamp: Option<f64>,
date: Option<date::Date>,
Expand Down Expand Up @@ -289,7 +289,7 @@ impl DateTimeBuilder {
}
}

#[allow(clippy::too_many_arguments)]
#[allow(clippy::too_many_arguments, deprecated)]
fn new_date(
year: i32,
month: u32,
Expand Down
10 changes: 3 additions & 7 deletions src/items/combined.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,12 @@ use winnow::{

use crate::items::space;

use super::{
date::{self, Date},
primitive::s,
time::{self, Time},
};
use super::{date, primitive::s, time};

#[derive(PartialEq, Debug, Clone, Default)]
pub(crate) struct DateTime {
pub(crate) date: Date,
pub(crate) time: Time,
pub(crate) date: date::Date,
pub(crate) time: time::Time,
}

pub(crate) fn parse(input: &mut &str) -> ModalResult<DateTime> {
Expand Down
14 changes: 14 additions & 0 deletions src/items/epoch.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,20 @@
// For the full copyright and license information, please view the LICENSE
// file that was distributed with this source code.

//! From the GNU docs:
//!
//! > If you precede a number with ‘@’, it represents an internal timestamp as
//! > a count of seconds. The number can contain an internal decimal point
//! > (either ‘.’ or ‘,’); any excess precision not supported by the internal
//! > representation is truncated toward minus infinity. Such a number cannot
//! > be combined with any other date item, as it specifies a complete
//! > timestamp.
//! >
//! > On most hosts, these counts ignore the presence of leap seconds. For
//! > example, on most hosts ‘@1483228799’ represents 2016-12-31 23:59:59 UTC,
//! > ‘@1483228800’ represents 2017-01-01 00:00:00 UTC, and there is no way to
//! > represent the intervening leap second 2016-12-31 23:59:60 UTC.

use winnow::{combinator::preceded, ModalResult, Parser};

use super::primitive::{float, s};
Expand Down
3 changes: 1 addition & 2 deletions src/items/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,13 @@
//! - [`combined`]
//! - [`date`]
//! - [`epoch`]
//! - [`pure`]
//! - [`relative`]
//! - [`time`]
//! - [`timezone`]
//! - [`weekday`]
//! - [`year`]

#![allow(deprecated)]

// date and time items
mod combined;
mod date;
Expand Down
Loading