0.1.6: fixed tests per language changes and .travis.yml.
This also switches to the crates.io dependency unconditionally.
This commit is contained in:
parent
7f5f176cce
commit
bf4ded9f07
|
@ -6,9 +6,6 @@ env:
|
|||
global:
|
||||
- LD_LIBRARY_PATH: /usr/local/lib
|
||||
- secure: i8Ijk6g4/26e3e7+r2OeGAPSP8G8O9P50JibW1omJ0j0ixXhyhPoY2bch3CGhnOu44dI5O31IIbjJJ+iEMp29xQBvkv9YpxAI+hIzOP+XAH6GCYxUDiBVcDoWrXTj+wU6/veuvjLCunu4eRHlskrgJbZXhUVODYzJuLgsN8Ou0w=
|
||||
before_script:
|
||||
- rustc -v
|
||||
- cargo -V
|
||||
script:
|
||||
- cargo build -v
|
||||
- cargo test -v
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
[package]
|
||||
name = "chrono"
|
||||
version = "0.1.5"
|
||||
version = "0.1.6"
|
||||
authors = ["Kang Seonghoon <public+rust@mearie.org>"]
|
||||
|
||||
description = "Date and time library for Rust"
|
||||
homepage = "https://github.com/lifthrasiir/rust-chrono"
|
||||
documentation = "https://lifthrasiir.github.io/rust-chrono/chrono/"
|
||||
documentation = "https://lifthrasiir.github.io/rust-chrono/"
|
||||
repository = "https://github.com/lifthrasiir/rust-chrono"
|
||||
keywords = ["date", "time", "calendar"]
|
||||
readme = "README.md"
|
||||
|
@ -14,6 +14,6 @@ license = "MIT/Apache-2.0"
|
|||
[lib]
|
||||
name = "chrono"
|
||||
|
||||
[dependencies.time]
|
||||
git = "https://github.com/rust-lang/time"
|
||||
[dependencies]
|
||||
time = "0.1.4"
|
||||
|
||||
|
|
18
README.md
18
README.md
|
@ -1,12 +1,12 @@
|
|||
Chrono
|
||||
======
|
||||
[Chrono][doc] 0.1.6
|
||||
===================
|
||||
|
||||
[![Chrono on Travis CI][travis-image]][travis]
|
||||
|
||||
[travis-image]: https://travis-ci.org/lifthrasiir/rust-chrono.png
|
||||
[travis]: https://travis-ci.org/lifthrasiir/rust-chrono
|
||||
|
||||
Date and time handling for Rust.
|
||||
Date and time handling for Rust. (also known as `rust-chrono`)
|
||||
It aims to be a feature-complete superset of the [time](https://github.com/rust-lang/time) library.
|
||||
In particular,
|
||||
|
||||
|
@ -21,7 +21,9 @@ which Chrono builts upon and should acknowledge:
|
|||
* Dietrich Epp's [datetime-rs](https://github.com/depp/datetime-rs)
|
||||
* Luis de Bethencourt's [rust-datetime](https://github.com/luisbg/rust-datetime)
|
||||
|
||||
[Complete Documentation](https://lifthrasiir.github.io/rust-chrono/chrono/)
|
||||
[Complete Documentation][doc]
|
||||
|
||||
[doc]: https://lifthrasiir.github.io/rust-chrono/chrono/
|
||||
|
||||
## Overview
|
||||
|
||||
|
@ -119,11 +121,11 @@ The default `to_string` method also gives a reasonable representation.
|
|||
use chrono::{UTC, Offset};
|
||||
|
||||
let dt = UTC.ymd(2014, 11, 28).and_hms(12, 0, 9);
|
||||
assert_eq!(dt.format("%Y-%m-%d %H:%M:%S").to_string(), "2014-11-28 12:00:09".into_string());
|
||||
assert_eq!(dt.format("%a %b %e %T %Y").to_string(), "Fri Nov 28 12:00:09 2014".into_string());
|
||||
assert_eq!(dt.format("%Y-%m-%d %H:%M:%S").to_string(), "2014-11-28 12:00:09".to_string());
|
||||
assert_eq!(dt.format("%a %b %e %T %Y").to_string(), "Fri Nov 28 12:00:09 2014".to_string());
|
||||
assert_eq!(dt.format("%a %b %e %T %Y").to_string(), dt.format("%c").to_string());
|
||||
|
||||
assert_eq!(dt.to_string(), "2014-11-28T12:00:09Z".into_string());
|
||||
assert_eq!(dt.to_string(), "2014-11-28T12:00:09Z".to_string());
|
||||
~~~~
|
||||
|
||||
### Individual date and time
|
||||
|
@ -141,7 +143,7 @@ assert_eq!(Local::today(), Local::now().date());
|
|||
|
||||
assert_eq!(UTC.ymd(2014, 11, 28).weekday(), Weekday::Fri);
|
||||
assert_eq!(UTC.ymd_opt(2014, 11, 31), LocalResult::None);
|
||||
assert_eq!(UTC.hms_milli(7, 8, 9, 10).format("%H%M%S").to_string(), "070809".into_string());
|
||||
assert_eq!(UTC.hms_milli(7, 8, 9, 10).format("%H%M%S").to_string(), "070809".to_string());
|
||||
~~~~
|
||||
|
||||
`DateTime` has two methods, `date` and `time`,
|
||||
|
|
12
src/lib.rs
12
src/lib.rs
|
@ -4,9 +4,9 @@
|
|||
|
||||
/*!
|
||||
|
||||
# Chrono
|
||||
# Chrono 0.1.6
|
||||
|
||||
Date and time handling for Rust.
|
||||
Date and time handling for Rust. (also known as `rust-chrono`)
|
||||
It aims to be a feature-complete superset of the [time](https://github.com/rust-lang/time) library.
|
||||
In particular,
|
||||
|
||||
|
@ -122,11 +122,11 @@ The default `to_string` method also gives a reasonable representation.
|
|||
use chrono::{UTC, Offset};
|
||||
|
||||
let dt = UTC.ymd(2014, 11, 28).and_hms(12, 0, 9);
|
||||
assert_eq!(dt.format("%Y-%m-%d %H:%M:%S").to_string(), "2014-11-28 12:00:09".into_string());
|
||||
assert_eq!(dt.format("%a %b %e %T %Y").to_string(), "Fri Nov 28 12:00:09 2014".into_string());
|
||||
assert_eq!(dt.format("%Y-%m-%d %H:%M:%S").to_string(), "2014-11-28 12:00:09".to_string());
|
||||
assert_eq!(dt.format("%a %b %e %T %Y").to_string(), "Fri Nov 28 12:00:09 2014".to_string());
|
||||
assert_eq!(dt.format("%a %b %e %T %Y").to_string(), dt.format("%c").to_string());
|
||||
|
||||
assert_eq!(dt.to_string(), "2014-11-28T12:00:09Z".into_string());
|
||||
assert_eq!(dt.to_string(), "2014-11-28T12:00:09Z".to_string());
|
||||
~~~~
|
||||
|
||||
### Individual date and time
|
||||
|
@ -145,7 +145,7 @@ assert_eq!(Local::today(), Local::now().date());
|
|||
|
||||
assert_eq!(UTC.ymd(2014, 11, 28).weekday(), Weekday::Fri);
|
||||
assert_eq!(UTC.ymd_opt(2014, 11, 31), LocalResult::None);
|
||||
assert_eq!(UTC.hms_milli(7, 8, 9, 10).format("%H%M%S").to_string(), "070809".into_string());
|
||||
assert_eq!(UTC.hms_milli(7, 8, 9, 10).format("%H%M%S").to_string(), "070809".to_string());
|
||||
~~~~
|
||||
|
||||
`DateTime` has two methods, `date` and `time`,
|
||||
|
|
Loading…
Reference in New Issue