856 Commits

Author SHA1 Message Date
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
Weiyuan Wu
e920210e2f add missing rkyv derives 2022-06-07 08:04:28 +02:00
Téo Bouvard
5bf8016068 Add support for double ended days+weeks iterators
This allows users to use `.rev()` on `.iter_days()` and `.iter_weeks()`,
in order to iterate on dates backwards.
2022-05-24 13:01:22 +02:00
Flurin Feuerstein
8f9b08a01f Fix typo in month.rs 2022-05-23 11:12:41 +02:00
Ethan D Twardy
7097f933eb
Fix "can't leak crate-private type in stub.rs" #662 (#684)
First attempt to fix this issue for wasm32-unknown-* targets by
changing visibility of functions not to leak crate-private types.

Ensure the default toolchain is used for the wasm_unknown CI test.
2022-05-12 14:45:47 +02:00
cuishuang
4333e39d13 fix some typos
Signed-off-by: cuishuang <imcusg@gmail.com>
2022-04-26 12:11:52 +02:00
Dirkjan Ochtman
279f590787 Reorder local module in top-down order 2022-04-10 21:42:34 +02:00
Dirkjan Ochtman
8c53efe3cc Deduplicate logic in datetime_to_timespec() callers 2022-04-10 21:42:34 +02:00
Dirkjan Ochtman
5ac1934bfe Inline single-use method Tm::to_timespec() 2022-04-10 21:42:34 +02:00
Dirkjan Ochtman
b36663b03b Fold top-level sys module into offset::local 2022-04-10 21:42:34 +02:00
Dirkjan Ochtman
5f59b2c24f Move sys module into offset, which is the only place using it 2022-04-10 21:42:34 +02:00
danielalvsaaker
29cbd5945c
Update absolute path to 2018 syntax for WASM/wasmbind feature (#672) 2022-04-09 14:17:43 +02:00
Yureka
49838124ff some lint errors from the 1.60 upgrade 2022-04-09 13:04:53 +02:00
Yureka
4cfcd405d1 add changelog entry 2022-04-09 13:04:53 +02:00
Yureka
a9ec3c9ca3 add wasm32-unknown-emscripten test 2022-04-09 13:04:53 +02:00
Yureka
a12cf7b724 use stub for anything not unix and not windows 2022-04-09 13:04:53 +02:00
Constantin Nickel
82407ffa9e Update bincode to 1.3 2022-04-05 15:50:52 +02:00
Constantin Nickel
4781689a39 Remove fallible fn main() in doc examples 2022-03-28 21:52:12 +02:00
Constantin Nickel
0b3a4f5aba Remove superfluous fn main() in doc examples 2022-03-28 21:52:12 +02:00
Constantin Nickel
c9db7d1f92 Remove extern crate statements from benches, tests & doc examples 2022-03-28 21:52:12 +02:00
Constantin Nickel
a6bf842a03 feat(naive): add serde modules for optional timestamps
- `naive::serde::ts_nanoseconds_option`
- `naive::serde::ts_microseconds_option`
- `naive::serde::ts_milliseconds_option`
- `naive::serde::ts_seconds_option`
2022-03-24 17:30:47 +01:00
Constantin Nickel
6471b362da feat(naive): add serde module for microseconds serialization 2022-03-24 17:30:47 +01:00