160 Commits

Author SHA1 Message Date
Dirkjan Ochtman
22b4d32498 Avoid use of deprecated API 2022-11-09 13:37:17 +01:00
Dirkjan Ochtman
645fca0c55 chore: apply clippy suggestions for 1.65 2022-11-09 11:47:50 +01:00
Conrad Ludgate
3e2f151613 remove dyn formatting from timezone (-74/78% on 2822/3339 respectively) 2022-10-26 15:59:01 +02:00
Conrad Ludgate
86325bc9aa avoid int formatting as much as possible (net -70%/-68% on 2822/3339 respectively) 2022-10-26 15:59:01 +02:00
Conrad Ludgate
8a90e128f8 skip DelayedFormat for rfc2822 (net -55% improvement for 2822) 2022-10-26 15:59:01 +02:00
Conrad Ludgate
8706fe0862 extract out locales for a later change 2022-10-26 15:59:01 +02:00
Conrad Ludgate
66491783a2 skip DelayedFormat for rfc3339 (net -58% improvement) 2022-10-26 15:59:01 +02:00
Conrad Ludgate
64e082a5f8 use less intermediate formatting (-5% improvement) 2022-10-26 15:59:01 +02:00
Dirkjan Ochtman
7cd5e03ee4 Fix up internal calls to newly deprecated methods 2022-10-09 14:15:02 +02:00
Eric Sheppard
3421cbdeeb extra imports due to powerset features check 2022-09-26 12:47:29 +02:00
René Kijewski
16b2ae4156 Add feature documentation for docs.rs
This way the documentation will thell user which feature(s) are needed
to use a function, trait, etc. docs.rs display the information like

> Available on crate feature `serde` only.
2022-08-22 20:26:38 +02:00
Jarosław Konik
5f5410163b
GNU coreutils date-like time zone formatting (#759)
Co-authored-by: Eric Sheppard <key2@eric.sheppard.cloud>
2022-08-17 18:41:48 +02:00
Mohammad AlSaleh
8275b13941
strftime: Improve "%+" documentation (#769) 2022-08-14 13:56:27 +02:00
Dirkjan Ochtman
db8bde3acf Apply clippy suggestions 2022-08-13 15:33:52 +02:00
Dirkjan Ochtman
95223ee267 format: be specific about support year range 2022-08-10 07:16:49 +02:00
Eric Sheppard
557bcd5f44
handle missing /etc/localtime on some unix platforms (#756)
* msrv -> 1.38

* default to UTC  when iana-time-zone errors and /etc/localtime is missing, support android

fix function name
2022-08-09 23:43:30 +10:00
Alex Gaynor
5edf4d0cc7
fixes #758 -- correctly document that %Y parses negative years (#760) 2022-08-09 22:15:17 +10: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
Finomnis
acd4ecf09f
Add compatibility with rfc2822 comments (#733)
* Add compatibility with rfc2822 comments

* Refactor rfc2822 comment parser
2022-07-24 20:17:38 +10:00
Dirkjan Ochtman
3550128fa0 Prefer associated consts for MIN and MAX values 2022-07-04 15:07:06 +02: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
ad03bcbdcb Check for overflow when parsing datetime 2022-06-09 10:55:09 +02:00
cuishuang
4333e39d13 fix some typos
Signed-off-by: cuishuang <imcusg@gmail.com>
2022-04-26 12:11:52 +02:00
Constantin Nickel
4781689a39 Remove fallible fn main() in doc examples 2022-03-28 21:52:12 +02:00
Dirkjan Ochtman
66898813de Reduce lint allowing 2022-03-21 22:32:31 -07:00
Dirkjan Ochtman
2368e37f8e Adopt modern clippy suggestions 2022-03-21 22:20:27 -07:00
Dirkjan Ochtman
733aa10a63 Get rid of most extern crate statements 2022-03-21 21:27:42 -07:00
Dirkjan Ochtman
b72d747423 Delete div module in favor of direct imports 2022-03-21 21:27:42 -07:00
Dirkjan Ochtman
2558a93d1a Enable warning on unreachable_pub 2022-03-21 21:27:42 -07:00
Dirkjan Ochtman
e4c8a529f5 Update to 2018 edition (and MSRV 1.32) 2022-03-19 20:38:12 -07:00
Dirkjan Ochtman
216c18f62a Clean up clippy warnings 2022-02-28 18:05:35 +01:00
Brandon W Maister
f03bce1b15 lint: Some new rustc lints. 2021-10-18 22:03:10 -04:00
Rob Young
b0f32832a7
Add documentation for DateTime FromStr impl (#516)
Resolves #505
2020-12-22 11:04:17 -05:00
Rob Young
c9778f7583 Use backticks for documentation examples
The rustdoc documentation and the book only show examples as escaped
with backticks.
2020-11-30 21:54:46 +00:00
Brandon W Maister
8c7e192a62 handle clippy::single-char-add-str 2020-11-20 12:38:35 -05:00
Thomas
f684ebfbee Add some documentation and examples for formatting 2020-11-10 12:20:06 +01:00
Aleksandr Bashurov
f4c42b4f14
Skip IANA TZ names when parsing %Z specifier (#473) 2020-08-21 11:56:10 -04:00
Brandon W Maister
65e6dbd110 Get rid of unnecessary Vec in default path of format_inner
Also slightly refactor to make the locales feature's impact easier to
visualize.
2020-08-14 16:32:37 -04:00
Cecile Tonglet
8d6d83f7b8
Locales and format_localized (#453) 2020-07-31 10:05:40 -04:00
Brandon W Maister
135e86ecd0 Make compatible with no_std 2020-07-24 14:43:12 -04:00
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
Brandon W Maister
febb8dc168 rustfmt everything 2020-06-27 17:04:22 -04:00
Brandon W Maister
77ade72ec8 clippy: match_ref_pats 2020-06-27 16:55:15 -04:00
Yuchen Wu
65eebdaaaa Fix comment: correct the comment of RFC2822 format
d.day() is u32 so the padding here is '0'(%d) not ' '(%e).
2020-06-16 13:08:52 -07:00
Brandon W Maister
b9af436698 Fix borrow rules for 1.13.0 2020-06-05 14:29:32 -04:00
Brandon W Maister
321d760d69 Fix function inclusion with serde and no other default features 2020-06-05 14:11:24 -04:00
Brandon W Maister
0ca999e1fa Fix format with format_inner
padding should only be applied after all inner formats have been built.
2020-05-27 22:49:20 -04:00
Sergey Todyshev
f450ae3237 extract format_item function 2020-04-08 22:07:01 +07:00