Paul Dicker
51cce84b86
Move stub into local/mod.rs
2023-05-26 14:34:50 +02:00
Paul Dicker
2b7a068be8
Only implement the offset_from_
methods on Local
2023-05-26 14:34:50 +02:00
Paul Dicker
7fb3e5921c
Just rely on the standard library for Local::now
2023-05-26 14:34:50 +02:00
Paul Dicker
bdf8b19515
Deny warnings in doctests
2023-05-26 12:16:08 +02:00
Paul Dicker
1d16082390
Use deserialization result in doctests
2023-05-26 12:16:08 +02:00
Paul Dicker
c14b3bb5f9
Fix documentation that is no longer true
2023-05-26 12:16:08 +02:00
Paul Dicker
7c90f35a65
Ensure results are used
2023-05-26 12:16:08 +02:00
Paul Dicker
799cf8d18b
Update main examples and use ?
2023-05-26 12:16:08 +02:00
Paul Dicker
03a64cefd2
Avoid deprecated methods in doctests
2023-05-26 12:16:08 +02:00
Paul Dicker
e86df391a3
Remove unused imports in doctests
2023-05-26 12:16:08 +02:00
Paul Dicker
8beda4cbeb
Remove mention of deprecated Date
in main documentation
2023-05-26 12:16:08 +02:00
RumovZ
b4c7fb4688
Extract timezone info from tzdata file on Android ( #978 )
2023-05-26 11:40:19 +02:00
Paul Dicker
403b247aff
Change NaiveDate::from_of
to take ordinal and year flags
2023-05-23 11:00:16 +02:00
Paul Dicker
7d98475f77
Ensure Of
is always valid
2023-05-23 11:00:16 +02:00
Paul Dicker
210f2689ee
Make internal functions returning Weekday const
2023-05-23 11:00:16 +02:00
Paul Dicker
d3c23e65e0
Make fns in internals const
2023-05-23 11:00:16 +02:00
Paul Dicker
327e5ee454
Reformat test_datetime_parse_from_str
2023-05-22 13:19:15 +02:00
jtmoon79
bf9f876388
add test_issue_866
...
Add single test case specific to Issue #866
2023-05-22 10:09:53 +02:00
Paul Dicker
cb27ebf7bf
Fix out-of-range panic in NaiveWeek::last_day
2023-05-19 15:54:52 +02:00
Paul Dicker
b6b35dc932
Make test_naiveweek clearer by including the day of week
2023-05-19 15:54:52 +02:00
Dirkjan Ochtman
07398a6270
Remove AUTHORS metadata
...
This file hasn't been kept up to date, and it's easy to get the
data from GitHub.
2023-05-19 15:27:20 +02:00
Paul Dicker
c944b9c396
Add parse_and_remainder methods
2023-05-19 14:55:43 +02:00
Kurtis Nusbaum
76285956af
add and_utc_timezone function
2023-05-19 13:57:44 +02:00
Jonas Heylen
ada0629bb4
Fix link in serde docs
2023-05-17 14:03:01 +02:00
Mahmoud Al-Qudsi
2269200cb5
Update RFC 2822 and RFC 3339 docs
...
Clarify the behavior of the parse methods, the relationship between ISO 8601 and
RFC 3339, and use a brief description on the first line of each function's
rustdoc to keep the resulting documentation pretty and concise.
2023-05-17 14:03:01 +02:00
Eric Sheppard
b0983c25d9
Remove dependency on num-traits
...
Co-authored-by: Dirkjan Ochtman <dirkjan@ochtman.nl>
2023-05-17 14:03:01 +02:00
Paul Dicker
eb927846b6
Add DateTime::fixed_offset
2023-05-15 16:10:59 +02:00
Paul Dicker
7bf98de158
[CI] Test rustdoc
2023-05-15 15:19:10 +02:00
Paul Dicker
d70eb453a9
Fix broken links
2023-05-15 15:19:10 +02:00
Paul Dicker
3b3432e94c
Add link checker to CI
2023-05-15 15:19:10 +02:00
Paul Dicker
40ed3bf063
Update github actions
2023-05-15 15:19:10 +02:00
Paul Dicker
fc8513b88c
[CI] Lint Windows target
2023-05-15 15:19:10 +02:00
Paul Dicker
5dd7961c86
No need to allow clippy::manual-non-exhaustive
2023-05-15 15:19:10 +02:00
Paul Dicker
e3f591fba3
Remove num-integer dependency
2023-05-15 13:02:13 +02:00
Paul Dicker
3bfb6abbbf
Fix test_leap_second during DST transition
2023-05-15 11:39:47 +02:00
Paul Dicker
0367c76a9f
Simplify from_timestamp_millis, from_timestamp_micros
2023-05-15 11:37:50 +02:00
Tormod Gjeitnes Hellen
2a6a07d967
Make eligible functions const.
2023-05-15 10:48:13 +02:00
jtmoon79
8fd7ca24bb
cargo fmt updates
...
Run `cargo fmt`. Changes to `src/datetime/tests.rs`.
2023-05-15 10:48:13 +02:00
jtmoon79
1a233aa75d
Constrain timezone parsing
...
Constrain timezone parsing further. Only allow optional colon
char `:` between timezone hour offset and timezone minute offset.
Issue #660
2023-05-15 10:48:13 +02:00
jtmoon79
f90d4037f0
Constrain timezone separator colon strings
...
Constrain timezone middle-colon separator string from
infinite intermixed whitespace and colons
to possible patterns `":"`, `" "`, `" :"`, `": "`, or `" : "`.
A reasonable trade-off of previous extreme flexibility for
a little flexbility and concise input.
Issue #660
2023-05-15 10:48:13 +02:00
jtmoon79
eb94e813d2
Add tests for timezone parsing whitespace and colon
...
Add tests for timezone parsing infinite whitespace and colons.
Prepatory tests for next commit around constraining timezone and
colons.
2023-05-15 10:48:13 +02:00
jtmoon79
1f45d8ed3f
Exact whitespace parsing
...
Be exact about allowed whitespace around and between data and
parsing formats for all parsing.
Except RFC 2822 which explicitly allows arbitrary whitespace.
Issue #660
2023-05-15 10:48:13 +02:00
jtmoon79
bc58a7db52
Add various tests for current parsing
...
Add more varying testing for most parsing functions.
Tests emphasize whitespace, literals, timezones, and timezone
delimiters (colons and whitespace).
Add tests for multiple-byte characters and combining characters
in and around data and parsing formats.
These tests are added to aid humans verifying the next commit that
changes parsing behavior.
Issue #660
2023-05-15 10:48:13 +02:00
Paul Dicker
6655649e86
Gate test on clock
feature
2023-05-12 10:06:02 +02:00
Paul Dicker
6a37b4c91e
Use correct offset in conversion from Local to FixedOffset
2023-05-12 08:51:17 +02:00
Paul Dicker
595955c482
Add test for impl From<DateTime<Local>> for DateTime<FixedOffset>
2023-05-12 08:51:17 +02:00
Paul Dicker
38d9132bea
Only run test on windows with clock feature
2023-05-12 08:50:07 +02:00
Paul Dicker
386f32705e
[CI] Run tests with --no-default-features
2023-05-12 08:50:07 +02:00
Mahmoud Al-Qudsi
28b2200f4f
Ignore unsupported doc tests under --no-default-features
...
There's no pretty way of gating doctests contingent on cfg
presence/absense so this is kind of ugly.
First, a doc comment `///` is converted into its equivalent
`#[doc(...)]`, which is then converted into a conditional rust attribute
via `#[cfg_attr(...)]`. We need two of these, one to ignore the tests if
the cfg predicate isn't met and another to indicate the start of a code
block and enable testing + syntax highlighting.
2023-05-12 08:50:07 +02:00
Paul Dicker
e0c4926841
Fix import
2023-05-12 08:50:07 +02:00