Commit Graph

532 Commits

Author SHA1 Message Date
SamokhinIlya 8b2444c27f DelayFormat now works with alignment and width 2019-06-21 23:44:49 +03:00
Brandon W Maister 96c451ec20
Merge pull request #316 from GuillaumeGomez/doc-test
Add doc-comment to test README examples and fix README examples
2019-05-01 22:07:13 -04:00
Guillaume Gomez b7003373f2 Add doc-comment to test README examples and fix README examples 2019-04-30 23:29:57 +02:00
Brandon W Maister 1407309b87
Merge pull request #313 from kennytm/inline-fixed-offset-getters
Mark `FixedOffset::{local_minus_utc, utc_minus_local}` as `#[inline]`.
2019-04-22 10:46:06 -04:00
kennytm 20a0ab7a47
Mark `FixedOffset::{local_minus_utc, utc_minus_local}` as `#[inline]`. 2019-04-22 03:07:01 +08:00
Brandon W Maister 7bc2cd8641
Merge pull request #312 from kennytm/derive-for-local-result
derive {Copy, Eq, Hash} for LocalResult.
2019-04-21 13:05:04 -04:00
kennytm d3dc9c0e10
derive {Copy, Eq, Hash} for LocalResult. 2019-04-21 15:42:11 +08:00
Brandon W Maister bcdc66a4f8
Merge pull request #271 from mqudsi/offset_convert
Add std::convert::From conversion between different DateTime offsets
2019-04-08 12:37:01 -04:00
Mahmoud Al-Qudsi 43447e5dbf Update Changelog to mention `std::convert::From` conversions 2019-04-08 10:15:19 -05:00
Mahmoud Al-Qudsi ad6872c498 Predicate `Local` conversion fns on `clock` feature 2019-04-08 10:06:30 -05:00
Brandon W Maister 5dc8a68dde
Merge pull request #308 from jean-airoldie/time_zone_from_nanos
Add timestamp_nanos generated method for TimeZone
2019-04-07 17:41:52 -04:00
Brandon W Maister cd2c58816d
Merge pull request #311 from quodlibetor/document-timestamp-nanos-panics
Document timestamp_nanos panics
2019-04-07 17:40:22 -04:00
Brandon W Maister 95bf861ceb Disable libc default features so it builds on rust 1.13 2019-03-31 19:03:18 -04:00
Brandon W Maister 855a894393 Don't warn on deprecated trim functions 2019-03-31 19:03:18 -04:00
Brandon W Maister 33800c876b Add docs around panic behavior around timestamp_nanos
Document panic behavior that should have been documented better.

Resolves #310
2019-03-31 19:03:18 -04:00
jean-airoldie c92544923d Add timestamp_nanos generated method for TimeZone 2019-03-06 10:32:40 -05:00
Brandon W Maister 77110ffecb
Merge pull request #292 from cmars/negative_timestamp_millis
Fix panic for negative inputs to timestamp_millis.
2018-12-04 15:47:03 -05:00
Casey Marshall b39597f537 Fix panic for negative inputs to timestamp_millis.
This patch fixes the case where a negative millisecond offset is passed
to Timezone::timestamp_millis and timestamp_millis_opt and adds a test
case for it. Without this patch, calling timestamp_offset with a
negative value will panic with an overflow like this:

```
---- tests::test_parse_samples stdout ----
thread 'tests::test_parse_samples' panicked at 'attempt to multiply with
overflow',
/home/c/.cargo/registry/src/github.com-1ecc6299db9ec823/chrono-0.4.6/src/offset/mod.rs:349:34
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a
verbose backtrace.
stack backtrace:
   0: std::sys::unix::backtrace::tracing:đź‘ż:unwind_backtrace
             at libstd/sys/unix/backtrace/tracing/gcc_s.rs:49
   1: std::sys_common::backtrace::print
             at libstd/sys_common/backtrace.rs:71
             at libstd/sys_common/backtrace.rs:59
   2: std::panicking::default_hook::{{closure}}
             at libstd/panicking.rs:211
   3: std::panicking::default_hook
             at libstd/panicking.rs:221
   4: std::panicking::rust_panic_with_hook
             at libstd/panicking.rs:477
   5: std::panicking::continue_panic_fmt
             at libstd/panicking.rs:391
   6: rust_begin_unwind
             at libstd/panicking.rs:326
   7: core::panicking::panic_fmt
             at libcore/panicking.rs:77
   8: core::panicking::panic
             at libcore/panicking.rs:52
   9: chrono::offset::TimeZone::timestamp_millis_opt
             at
/home/c/.cargo/registry/src/github.com-1ecc6299db9ec823/chrono-0.4.6/src/offset/mod.rs:349
  10: chrono::offset::TimeZone::timestamp_millis
             at
/home/c/.cargo/registry/src/github.com-1ecc6299db9ec823/chrono-0.4.6/src/offset/mod.rs:327
```
2018-12-02 11:26:42 -06:00
Brandon W Maister 5dc483990a
Merge pull request #282 from 3point2/doc-grammar
Grammar fix for docs
2018-11-26 23:23:36 -05:00
Brandon W Maister 9ab410728c
Merge pull request #279 from bachp/duration-link
Correct link to standard Durtation
2018-11-26 23:22:35 -05:00
Brandon W Maister 8c1817d98e
Merge pull request #283 from ignatenkobrain/patch-2
exclude CI files from crates.io
2018-11-26 23:20:46 -05:00
Igor Gnatenko 5f74978778
exclude CI files from crates.io 2018-10-31 12:11:46 +01:00
Vasili Revelas 8abaae199e Grammar fix for docs 2018-10-27 13:09:32 +03:00
Pascal Bach fd22be2c8f Correct link to standard Durtation
The link mentioning standard Duration was still linking to the
Duration from the time crate
2018-10-09 23:19:59 +02:00
Mahmoud Al-Qudsi 973c603d7a Add basic conversion test 2018-09-05 19:08:46 -05:00
Mahmoud Al-Qudsi 7f4d0da7f1 Add doc ccomments for conversions between `DateTime` flavors
Documentation added to both `impl`s and functions so that they are
visible to both users perusing the online documentation and in
autocomplete/intellisense engines.
2018-09-05 18:25:32 -05:00
Brandon W Maister 94b43fa2e8 Bump Chrono version to 0.4.6 2018-08-25 16:47:10 -04:00
Brandon W Maister 5a1c702b60
Merge pull request #275 from quodlibetor/ci-for-readme
Make README.md match lib.rs mod documentation
2018-08-25 16:45:18 -04:00
Brandon W Maister 2e563bc652 Make README.md match lib.rs mod documentation
And fail CI in the future if `make readme` isn't run when it is needed.

CC conversation in #185, where the README didn't get updated for a year after
lib.rs was improved.
2018-08-25 16:24:07 -04:00
Brandon W Maister a648423e94
Merge pull request #274 from Eh2406/minimal-versions
bump time to use winapi 0.3
2018-08-18 18:25:17 -04:00
Finkelman 701d36536b bump rustc-serialize to a vertion that builds on modern rust 2018-08-18 15:29:48 -04:00
Eh2406 5fc6edd928 bump time to use winapi 0.3 2018-08-17 19:00:37 -04:00
Brandon W Maister b49848d680
Merge pull request #269 from afgomez/patch-1
Update broken links to `time::Duration`
2018-08-14 11:04:31 -04:00
Mahmoud Al-Qudsi 855d5f2772 Add initial implementation of std::convert::From for DateTime offsets
Adds conversion to/from Utc, Local, and FixedOffset. Originally planned
to go through NaiveDateTime, but it seems that is not necessary?
2018-08-11 22:12:11 -05:00
Alejandro Fernández 4b2a287776
Update broken links to `time::Duration` 2018-08-06 20:41:02 +02:00
Brandon W Maister 8fceba82f4 Bump Chrono version to 0.4.5 2018-07-28 17:12:03 -04:00
Brandon W Maister b975d7a2ff Add another change to the changelog 2018-07-28 17:09:40 -04:00
Brandon W Maister 369ce72987
Merge pull request #252 from quodlibetor/negative-timestamps
Add doctests around negative timestamps
2018-07-28 17:07:04 -04:00
Brandon W Maister 55538b5b9c
Merge pull request #268 from quodlibetor/TimeZone-timestamp-millis
Add `timestamp_millis` and `timestamp_millis_opt`
2018-07-28 16:41:34 -04:00
Brandon W Maister a58a833324 Add doctests for negative timestamps 2018-07-28 16:40:26 -04:00
Brandon W Maister 5481dec823 Don't warn on an unknown allowed clippy lint 2018-07-28 15:25:37 -04:00
Brandon W Maister ffb27b8cc7 Add changelog entries for already-merged changes 2018-07-28 15:24:48 -04:00
Brandon W Maister 19955ac992 Add `timestamp_millis` and `timestamp_millis_opt`
Fixes #264
2018-07-28 15:18:32 -04:00
Brandon W Maister 512f21d481
Merge pull request #258 from novacrazy/extra-serde
Extra serde modules for various timestamp formats.
2018-07-28 14:45:42 -04:00
Brandon W Maister ad543a75ef
Merge pull request #267 from davidtwco/playground-metadata
Enable all features on Rust Playground.
2018-07-28 14:39:44 -04:00
David Wood b57e815da7
Enable all features on Rust Playground. 2018-07-21 19:24:24 +01:00
Brandon W Maister 7b612e9ae0
Merge pull request #261 from storyfeet/format-pointer
Tried to make it easier to find specifiers
2018-07-18 21:54:53 -04:00
storyfeet 611abbd7ae trivially copy pass by ref 2018-07-18 21:38:37 -04:00
storyfeet b9b09b8e11 Tried to make it easier to find specifiers 2018-07-18 21:38:37 -04:00
novacrazy a88ee8f719 Fix doc 2018-07-18 04:45:11 -05:00