977 Commits

Author SHA1 Message Date
Dirkjan Ochtman
65f1f2e588 Bump version to 0.4.20 2022-08-04 16:44:23 +02:00
Dirkjan Ochtman
bd3b48d1a9 Revise Months API
* Provide `checked_add_months()` and `checked_sub_months()` for
  callers that would like to avoid panics
* Document panic potential in `Add` and `Sub` implementations
* Implement additional traits for `Months` per API guidelines
* Hide inner type for `Months` and add constructor
* Use lower-level APIs to clamp day
2022-08-04 16:05:25 +02:00
Brent Gardner
ab688c384f
Implement Add<Months> and Sub<Months> for NaiveDate (#731)
* Add add_months()
* Months struct with Add and Sub impls
* Update changelog
2022-07-30 22:39:13 +10:00
Kevin Cox
782f904375 Clarify docs for DateTime::with_timezone
The previous docs don't really make sense, why am I calling a method if it doesn't change the value? The new wording clarifies what is held the same and what changes.
2022-07-29 16:43:51 +02:00
Eric Sheppard
27c05589ac dont use stub.rs when wasmbind feature is enabled
no longer require wasmbind feature to get js-sys on wasm32-unknown-unknown target

fix comment and remove wasmbind feature from tests

add wasi test

add wasi test
2022-07-28 13:57:09 +02:00
Eric Sheppard
56f80e4366 run on all branches and also for changes in the ci folder 2022-07-28 13:57:09 +02:00
Dirkjan Ochtman
353f1795b6 Implement std::error::Error for ParseWeekdayError 2022-07-27 16:29:50 +02:00
Michael
309cbeb054 Fixed typo in deprecation notice 2022-07-27 08:47:47 +02:00
Dirkjan Ochtman
26e231af33 Bump version to 0.4.20-rc.1 v0.4.20-rc.1 2022-07-26 14:20:42 +02:00
Finomnis
5eacc0a698 Fixed incorrect whitespace parsing; added more tests 2022-07-26 09:59:19 +02:00
Eric Sheppard
b2430c2b77 change to raw strings 2022-07-26 09:59:19 +02:00
Dirkjan Ochtman
ad1fe57f9b Simplify RFC 2822 comment parser 2022-07-26 09:59:19 +02:00
Eric Sheppard
0903ab1a19
use thread_local cache of parsed version of previous TzInfo file or TZ variable (#728)
minor fixes

improve ergonomics, cache mtime for 1s

1.32 fixes

avoid excess Cache::default() calls

add back cfg_attr
2022-07-25 22:12:35 +10:00
Finomnis
acd4ecf09f
Add compatibility with rfc2822 comments (#733)
* Add compatibility with rfc2822 comments

* Refactor rfc2822 comment parser
v0.4.20-beta.1
2022-07-24 20:17:38 +10:00
Andre Braga Reis
187819ff43 Update the changelog 2022-07-15 09:04:09 +02:00
Andre Braga Reis
07e4dcef00 Fix Duration::abs when nanos is not zero 2022-07-15 09:04:09 +02:00
Eric Sheppard
051e1170c4 fix clippy lint 2022-07-07 15:44:39 +02:00
Dirkjan Ochtman
686f72038e Simplify cross installation 2022-07-04 15:07:06 +02:00
Dirkjan Ochtman
3550128fa0 Prefer associated consts for MIN and MAX values 2022-07-04 15:07:06 +02:00
Micha White
39ac80a6a5 Removed a couple of zero-prefixed literals 2022-06-25 22:41:46 +02:00
Dirkjan Ochtman
3ea7149bc7 Bump version to 0.4.20-beta.1 2022-06-25 14:20:36 +02:00
Eric Sheppard
b1d74aef68 remove experimental and clarify why function is fallible 2022-06-21 14:41:36 +02:00
Micha White
cb9239828a
NaiveDateTime to DateTime helper method (#711)
* Added a and_timezone method

* Added a couple of tests

* Added the change to the changelog

* Wrong name, silly

* Fixed formatting

* Changed the method name

* Added a disclaimer to the documentation
2022-06-19 22:10:17 +10:00
metent
13e1d48365
Remove unused libc dependency from Cargo.toml (#710)
* Remove unused libc dependency from Cargo.toml

* Add libc feature to prevent potentially breaking change

* Document libc dependency removal
2022-06-17 10:55:18 +10:00
Sebastián Estrella
8dd7245f85
[#654] Get week start and end days (#666)
Co-authored-by: David Mazarro <dmunuera@stackbuilders.com>
Co-authored-by: Jorge Guerra <jguerra@stackbuilders.com>
2022-06-15 14:01:18 +02:00
0xc0001a2040
3c0d274aaa
Add AddAssign/SubAssign implementation to DateTime/Date (#698)
* Impl AddAssign and SubAssign for Date and DateTime

* Add tests for AddAssign and SubAssign

* Add tests for AddAssign and SubAssign on Date

* AddAssign/SubAssign impls mimic their checked methods

* Gate tests for Local timezone behind clock feature

* make sure add/sub_assign_local tests cross a DST transition if relevant

Co-authored-by: Eric Sheppard <key1@eric.sheppard.cloud>
2022-06-11 15:55:34 +10:00
Bryan Henry
d7c743e47a
Make ParseErrorKind public and available through ParseError::kind() (#588)
Co-authored-by: Dirkjan Ochtman <dirkjan@ochtman.nl>
Co-authored-by: Erlend Langseth <3rlendhl@gmail.com>
2022-06-09 11:34:09 +02:00
Micha White
150f6d1036 Added the change and my username to the changelog 2022-06-09 10:55:09 +02:00
Micha White
ad03bcbdcb Check for overflow when parsing datetime 2022-06-09 10:55:09 +02:00
Eric Sheppard
50eb7e363d handle localtime ambiguity 2022-06-09 10:42:30 +02:00
Eric Sheppard
2caab3493e Test Local functions against date command (#682) 2022-06-09 10:42:30 +02:00
Dirkjan Ochtman
2e711e7936 Clarify module hierarchy 2022-06-09 10:42:30 +02:00
Dirkjan Ochtman
f5218bfa13 sys/unix: cache time zone info 2022-06-09 10:42:30 +02:00
Dirkjan Ochtman
4646ec2c1c sys/unix: parse tzinfo files to find local time offset
Based on tz-rs commit b8675e2b5794d923f80970daf9ea548cfb998db2,
with substantial modifications from me.
2022-06-09 10:42:30 +02:00
Dirkjan Ochtman
c76d02a72c sys/unix: inline some more trivial functions 2022-06-09 10:42:30 +02:00
Dirkjan Ochtman
6411fcd456 sys/unix: reorder functions 2022-06-09 10:42:30 +02:00
Dirkjan Ochtman
8f5c77728a sys/unix: extract imports to global level 2022-06-09 10:42:30 +02:00
Dirkjan Ochtman
f78c833f02 sys/unix: skip conversion to intermediate type 2022-06-09 10:42:30 +02:00
Dirkjan Ochtman
83d479bf10 sys/unix: inline more single-use functions 2022-06-09 10:42:30 +02:00
Dirkjan Ochtman
e35c0b7b0a sys/unix: move duplicate code into renamed localize() function 2022-06-09 10:42:30 +02:00
Dirkjan Ochtman
d707394bd2 sys/unix: inline uses of Timespec type and methods 2022-06-09 10:42:30 +02:00
Dirkjan Ochtman
41cfd49d77 sys/unix: clarify type of time_to_local_tm() 2022-06-09 10:42:30 +02:00
Dirkjan Ochtman
e0beafd94f sys/unix: remove pointless platform guards 2022-06-09 10:42:30 +02:00
Dirkjan Ochtman
945d08e6a7 sys/unix: skip conversion to intermediate type 2022-06-09 10:42:30 +02:00
Dirkjan Ochtman
cd27579895 sys: duplicate vaguely platform-specific code 2022-06-09 10:42:30 +02:00
Jake Vossen
7c0bc31a63
Implement std::iter::Sum for Duration (#522) 2022-06-09 10:01:13 +02:00
Dirkjan Ochtman
752e69ae1f Morph elapsed_years() API into years_since() 2022-06-08 14:14:38 +02:00
Yohan Boogaert
1d33cbcb6e
Add elapsed_years to Date and DateTime (#557)
Co-authored-by: Cecile Tonglet <cecile.tonglet@cecton.com>
Co-authored-by: Milo <50248166+Milo123459@users.noreply.github.com>
2022-06-08 13:06:27 +02:00
Dirkjan Ochtman
3a7d0e4806 Fix formatting in GitHub workflows 2022-06-08 11:39:31 +02:00
Dirkjan Ochtman
6d392f077e Stop testing very old Ubuntu 2022-06-08 11:39:31 +02:00