71 Commits

Author SHA1 Message Date
hhamana
38810a33bf Adds a public Month enum.
Implementation for a Month enum, allowing -ser|de-rialization.
The implementation mostly mirrors the Weekday enum.
It only adds the enum with minimal integration so as to
not cause any backwards compatibility issue.
A deeper integration should be up to discussion.
Suggested in Issue #202
2020-07-24 14:43:12 -04:00
Rob Young
bfddc1e5fa Update CHANGELOG for day and week iterators 2020-07-24 13:11:13 -04:00
Rob Young
aaee912228
Add MIN and MAX DateTime, Time and NaiveDateTime (#452)
Resolves #386
2020-07-10 17:32:19 -04:00
Brandon W Maister
a905c556d8
Add unreleased section to changelog (#448) 2020-07-06 08:53:58 -04:00
Brandon W Maister
cc0e795b59 Release v0.4.13 2020-07-05 18:50:00 -04:00
Marc Schreiber
545fd9f863 Improve From<js_sys::Date> Variants for DateTime<Utc> 2020-07-05 16:50:57 -04:00
Rob Young
4348cd13c7
Add rounding and truncating by Duration (#445)
Resolves #280
2020-07-05 14:06:11 -04:00
Brandon W Maister
e90050c852
Prepare changelog for next release (#444) 2020-07-01 21:56:41 -04:00
Brandon W Maister
311659f2cc
Release v0.4.12 (#442) 2020-07-01 18:21:04 -04:00
Brandon W Maister
ea2d2da905
Remove oldtime::Duration::seconds_nanos (#441)
It causes a different _increased_ API when features are _disabled_.

It'll be re-added when #286 is finished
2020-07-01 18:08:15 -04:00
Brandon W Maister
8bc94d5281
Use js runtime for Local offset in js environment (#412)
Possible fix for #411
2020-06-29 19:02:24 -04:00
Brandon W Maister
b98c0cf62c
Update changelog to include changes since last release (#435) 2020-06-27 16:09:40 -04:00
Brandon W Maister
e493218d68
Update changelog for 0.4.11 (#399) 2020-03-07 16:16:02 -05:00
vallentin
89da02ebd5 Fixed typos 2020-02-11 21:08:21 +01:00
Brandon W Maister
4837b568c2
Merge pull request #381 from waldyrious/same-to_same-as
Reword 'same to' → 'same as'
2019-12-30 17:17:46 -05:00
Brandon W Maister
9397ab2b47
Merge pull request #375 from dlalic/354
Support comparison between dts with different timezones. Fixes #354
2019-12-30 17:16:06 -05:00
Waldir Pimenta
176dfeff87 Reword 'same to' --> 'same as' 2019-12-29 22:27:59 +00:00
Brandon W Maister
b9c967b2ac support round tripping display <-> datetime
This extends `FromStr` to allow either a `T` or a ` ` (space) as the delimiter
between the date and the time, and, because of the fact that the `Z`
parser-specifier is shared with the Fixed notation, extends the fixed notation
to support `UTC` in addition to `Z` as the zero-offset.

IMO this Fixes #147
2019-12-27 13:57:02 -05:00
Brandon W Maister
3b295ccb8f Add doctest for comparison between timestamps with different time_zones 2019-12-27 13:49:53 -05:00
Brandon W Maister
b9cd0ce803
Merge pull request #270 from asayers/from_ymwd
Construct a NaiveDate by specifying eg. "the 2nd Friday of March 2017"
2019-12-26 20:17:17 -05:00
Brandon W Maister
5d16648df4 rename from_ymwd -> from_weekday_of_month 2019-12-23 17:33:44 -05:00
Brandon W Maister
b10e430b1f
Merge pull request #368 from quodlibetor/support-negative-utc-in-rfc2822
Support -0000 as a valid UTC tz in rfc2822
2019-11-30 17:59:22 -05:00
Brandon W Maister
b553798f86 Support -0000 as a valid UTC tz in rfc2822
This is a time that is commonly set in some environments, and RFC 5322
explicitly clarifies that we should treat -0000 as UTC[1][2] when interpretting
rfc2822.

Fixes #102

[1]: https://github.com/chronotope/chrono/issues/102#issuecomment-557846931
[2]: https://tools.ietf.org/html/rfc5322#section-3.3
2019-11-30 16:48:35 -05:00
Brandon W Maister
00e6edd457
Merge pull request #367 from quodlibetor/0_4_10-compat-notes
Add compatility notes about the new alloc feature in 0.4.10
2019-11-29 15:01:00 -05:00
Brandon W Maister
3532e33ac2 Add compatility notes about the new alloc feature in 0.4.10
Closes #364
2019-11-29 14:19:22 -05:00
Brandon W Maister
8de2cc375f switch to using criterion for benchmarks
It has a ton of great features[1], including stronger statistical signifance
tests, making comparisons to previous or baseline runs, nice plots, and being
able to be run on stable.

1: https://bheisler.github.io/criterion.rs/book/
2019-11-24 13:51:27 -05:00
Brandon W Maister
41700d101e Remove unused constant, deny(dead_code) 2019-11-23 19:58:20 -05:00
Brandon W Maister
670561b4c1 Prepare for and Bump Chrono version to 0.4.10 2019-11-23 19:19:04 -05:00
Michal Srb
05acc869b9 Accept Borrow<Item> as items
The parse::parse and format::format functions accepted Iterator of owned
Items. While it is sometimes convenient to pass in the owned values,
neither of the functions really need to own them, so references would
be enough. The Borrow trait allows us to pass in Iterator over values,
references, boxes, etc.

According to RFC 1105 this is a minor change, because it shouldn't break
any existing code. And chrono is in pre-1.0 version anyway.

This allows us to remove multiple cloned() calls which speeds up parsing
and formating:

 name                                                 control ns/iter  remove-cloned ns/iter  diff ns/iter   diff %  speedup
 datetime::tests::bench_datetime_from_str             712              582                            -130  -18.26%   x 1.22
 datetime::tests::bench_datetime_parse_from_rfc2822   252              244                              -8   -3.17%   x 1.03
 datetime::tests::bench_datetime_parse_from_rfc3339   242              239                              -3   -1.24%   x 1.01
2019-11-23 23:34:59 +01:00
Brandon W Maister
2839d8d7db Put wasm-bindgen and js-sys behind a wasm-bindgen feature gate
Fixes #334
2019-09-03 09:05:15 -04:00
Brandon W Maister
6429cd2780 Add CHANGELOG entry for wasm-unknown-unknown
Features added in #287 and #331
2019-08-31 15:22:01 -04:00
Brandon W Maister
a448800727 Add CHANGELOG entry for upcoming unreleased changes 2019-06-25 09:44:13 -04:00
Brandon W Maister
579679b9c3 Add changelog entry for 0.4.7 2019-06-21 17:11:01 -04:00
Mahmoud Al-Qudsi
43447e5dbf Update Changelog to mention std::convert::From conversions 2019-04-08 10:15:19 -05:00
Alex Sayers
892bbf3f3a Add NaiveDate::from_ymwd_opt, implement from_ymwd in terms of it 2018-08-13 11:29:02 +09:00
Alex Sayers
4ffd411654 Add NaiveDate::from_ymwd
This contructor allows you to make a NaiveDate by specifying eg. "the
2nd Friday of March 2017".  It contains a couple of panics, but these
are consistent with the behaviour of the other NaiveDate constructors.
2018-08-13 11:29:02 +09: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
ffb27b8cc7 Add changelog entries for already-merged changes 2018-07-28 15:24:48 -04:00
Brandon W Maister
237042365e Update for 0.4.4 2018-06-23 17:32:44 -04:00
Evan Schwartz
074e92fc63 Document millisecond format without the dot 2018-06-12 10:51:36 -04:00
Brandon W Maister
f1852a6d21 Update changelog with TZ Offset Permissive 2018-06-10 21:35:41 -04:00
Thomas Bytheway
5d86c53679 Updated Changelog 2018-05-24 13:49:23 +01:00
Brandon W Maister
97dbfd02ab Bump version for 0.4.2 release 2018-04-07 17:51:56 -04:00
Brandon W Maister
1c4fc66323 Update changelog 2018-04-03 22:36:08 -04:00
Brandon W Maister
39ca2e622c Deprecated warnings in cargo output for rustc-serialize feature
Unfortunately due to rust-lang/rust#39935 placing the annotation on the `impl`s
of `Encodable`/`Decodable` for the various items have no effect whatsoever, so
we need to place it on some type that chrono actually uses internally. The only
*type* that I can find that only exists for rustc-serialize only is the
 `TsSeconds` struct.

So, marking TsSeconds deprecated causes Chrono's internal uses of `TsSeconds`
to emit deprecation warnings, both in our builds and for packages that specify
Chrono as a dependency with the `rustc-serialize` feature active. This means
that the current commit will cause a `warning: use of deprecated item:
RustcSerialize will be removed before chrono 1.0, use Serde instead` to appear
in `cargo build` output.

Unfortunately I don't think that it's possible for downstream crates to disable
the warning the warning in any way other than actually switching to Serde or
using an older chrono. That's the reason for all the `#[allow(deprecated)]`
through the code, it means that the warning appears almost exactly once,
instead of dozens of times.
2018-03-29 14:32:39 -04:00
Brandon W Maister
d889e3838f Update changelog for 0.4.1 2018-03-26 22:10:45 -04:00
Kang Seonghoon
fe529c8016
0.4.0: Mass renaming, IsoWeek, SystemTime supports, serde utils.
Starting from this version the `CHANGELOG.md` file is the canonical
source for the list of significant changes. See the file for details.

Fixes #146.
Fixes #159.
2017-06-22 02:59:46 +09:00
Kang Seonghoon
dcf193323b
0.3.1: Minor maintenance release, Serde 1.0 support.
- Serde 1.0 is now supported. (#142)

  Technically this is a breaking change, but the minor version was not
  effective in avoiding dependency breakages anyway (because Cargo
  will silently compile two versions of crates). Provided that this is
  likely the last breakage from Serde, we tolerate
  this more-than-last-minute change in this version.

- `Weekday` now implements `FromStr`, `Serialize` and `Deserialize`.
  (#113)

- Fixed a bug that the leap second can be mapped wrongly
  in the local tz with some conditions. (#130)

- Some changes to the tests to avoid previously known issues.

Note that the actually published version is very slightly different
from the repository because no published version of bincode supports
Serde 1.0 right now.
2017-05-02 03:13:00 +09:00
Kang Seonghoon
db9b98f691
0.3.0: Planned breaking changes to the existing interface.
So this is a much delayed major release, but this should not really
change how you use Chrono---only the "required" breakages have been
done (e.g. anything hindering API evolution). The "big" release used to
be 0.3, but due to the dependency changes we are forced to push that to
0.4. I've took this opportunity to push all known planned breaking
changes to 0.3, so this should be quite stable for a moment.

See `CHANGELOG.md` for the full list of changes, but most importantly:

- `chrono::prelude` module has been added for proper glob imports.

- `FixedOffset` is now the official "value" type for time zone offsets.

- Serde 0.9 support has landed, and serialization format used by
  rustc-serialize and Serde has been now synchronized.

- Formatting items have been slightly adjusted to be future-proof.

Fixes #126.
2017-02-07 05:52:07 +09:00