115 Commits

Author SHA1 Message Date
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
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
Constantin Nickel
0b3a4f5aba Remove superfluous fn main() in doc examples 2022-03-28 21:52:12 +02:00
Dídac Sementé Fernández
3f895ec06b * Adjusted doctest for unstable-locales 2020-12-27 13:14:16 +01:00
Nikhil Benesch
1402e8dd5e
Update duration docs for oldtime feature (#484)
The main crate docs made some claims about the Duration type that became
incorrect with the new oldtime feature (#478).

Per @jhpratt.
2020-09-26 10:57:33 -04:00
Nikhil Benesch
5115c6f5f9
Don't require time crate for clock feature (#478)
Absorb just enough of the time crate that it is no longer required for
the clock feature. v0.1 of the time crate is long deprecated, and v0.2 of
the crate is a complete rewrite.

Vendoring v0.1 allows chrono to control its own destiny. It also means
that downstream users that have upgraded to the time v0.2 ecosystem do
not wind up with both time v0.1 and v0.2 in the dependency tree.

Even with this patch, the dependency on the old time crate remains by
default for backwards compatibility. Specifically, the
`chrono::Duration` type is a re-export of the `time::Duration` type when
the `oldtime` feature is enabled, as it is by default. The intent is
that the `oldtime` feature will be removed when chrono v0.5 is released.

Supersedes #286.
Fixes #400.
2020-09-25 15:14:58 -04:00
Jason
c364de3f55
docs: fix link to cargo docs (#464) 2020-08-05 10:15:05 -04:00
Cecile Tonglet
8d6d83f7b8
Locales and format_localized (#453) 2020-07-31 10:05:40 -04:00
Brandon W Maister
0579d2af08
Document the features available to chrono users (#460) 2020-07-24 20:28:18 -04:00
Brandon W Maister
130253ef2b
Support testing on both main and master (#454) 2020-07-11 13:56:02 -04:00
Brandon W Maister
c2fe38cd84 clean up github workflows ui
This puts different kinds of tests in different job names, instead of
shoehorning them into the matrix.
2020-06-27 15:25:17 -04:00
Brandon W Maister
43db62eda3 Get rid of appveyor and travis configs 2020-06-26 12:37:57 -04:00
Brandon W Maister
8e1fdeaf95 Fix README generation
A previous PR updated the README instead of src/lib.rs, which should have been
caught by CI but was not.
2020-05-27 09:38:01 -04:00
Benoît Courtine
04a58593b3
Add a link to chrono_ext crate (and sources), for non ISO weeks handling (cf. issues #139 and #405). (#406) 2020-04-10 15:27:38 -04:00
Waldir Pimenta
176dfeff87 Reword 'same to' --> 'same as' 2019-12-29 22:27:59 +00:00
Lane Kolbly
63920fe65b Put change back into README 2019-07-18 08:02:45 -05:00
Lane Kolbly
c80878ce4e Change src/lib rather than readme directly 2019-07-18 07:37:37 -05:00
Lane Kolbly
91fac79807 Fix README specification for number_from_monday() 2019-07-13 10:01:55 -05:00
Brandon W Maister
403af6b298 Change README chrono version links to just 0.4
docs.rs redirects to the latest version in that range.
2019-06-21 17:49:50 -04:00
Guillaume Gomez
b7003373f2 Add doc-comment to test README examples and fix README examples 2019-04-30 23:29:57 +02:00
Pascal Bach
fd22be2c8f Correct link to standard Durtation
The link mentioning standard Duration was still linking to the
Duration from the time crate
2018-10-09 23:19:59 +02:00
Brandon W Maister
94b43fa2e8 Bump Chrono version to 0.4.6 2018-08-25 16:47:10 -04:00
Brandon W Maister
2e563bc652 Make README.md match lib.rs mod documentation
And fail CI in the future if `make readme` isn't run when it is needed.

CC conversation in #185, where the README didn't get updated for a year after
lib.rs was improved.
2018-08-25 16:24:07 -04:00
Alejandro Fernández
4b2a287776
Update broken links to time::Duration 2018-08-06 20:41:02 +02:00
Brandon W Maister
66005be6a2
Fix position of gitter badge. 2018-04-19 23:28:09 -04:00
The Gitter Badger
c2753f1158 Add Gitter badge 2018-04-20 03:23:21 +00:00
Brandon W Maister
a060684abe
Merge pull request #174 from quodlibetor/deprecated-warnings-for-rustc_serialize
Deprecated warnings in cargo output for rustc-serialize feature
2018-04-03 05:52:58 -07:00
Brandon W Maister
ba1b88ecbc Remove version number from README 2018-04-01 20:08:47 -04:00
skierpage
21d302f0d2
Update version number to 0.4.1
cargo.toml and crates.io are at 0.4.1. I don't know if you want to update the docs link and sample `Cargo.toml` lines.
2018-04-01 17:02:32 -07: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
Lance Carlson
11ee30cd77
Update README.md 2018-01-24 18:55:10 -05:00
Lance Carlson
884ad92802
Update README.md
Include the decimal values in the default output format
2018-01-24 11:50:25 -05: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
7b9b0c4437
Renamed chrono::UTC to chrono::Utc.
Fixes #148.
2017-06-22 00:33:17 +09:00
Kang Seonghoon
c06bc01f0b
Flattened intermediate implementation modules.
There used to be multiple modules like `chrono::datetime` which only
provide a single type `DateTime`. In retrospect, this module structure
never reflected how people use those types; with the release of 0.3.0
`chrono::prelude` is a preferred way to glob-import types, and due to
reexports `chrono::DateTime` and likes are also common enough.

Therefore this commit removes those implementation modules and
flattens the module structure. Specifically:

    Before                              After
    ----------------------------------  ----------------------------
    chrono:📅:Date                  chrono::Date
    chrono:📅:MIN                   chrono::MIN_DATE
    chrono:📅:MAX                   chrono::MAX_DATE
    chrono::datetime::DateTime          chrono::DateTime
    chrono::datetime::TsSeconds         chrono::TsSeconds
    chrono::datetime::serde::*          chrono::serde::*
    chrono::naive::time::NaiveTime      chrono::naive::NaiveTime
    chrono::naive:📅:NaiveDate      chrono::naive::NaiveDate
    chrono::naive:📅:MIN            chrono::naive::MIN_DATE
    chrono::naive:📅:MAX            chrono::naive::MAX_DATE
    chrono::naive::datetime::NaiveDateTime
                                        chrono::naive::NaiveDateTime
    chrono::naive::datetime::TsSeconds  chrono::naive::TsSeconds
    chrono::naive::datetime::serde::*   chrono::naive::serde::*
    chrono::offset::utc::UTC            chrono::offset::UTC
    chrono::offset::fixed::FixedOffset  chrono::offset::FixedOffset
    chrono::offset::local::Local        chrono::offset::Local
    chrono::format::parsed::Parsed      chrono::format::Parsed

All internal documentation links have been updated (phew!) and
verified with LinkChecker [1]. Probably we can automate this check
in the future.

[1] https://wummel.github.io/linkchecker/

Closes #161. Compared to the original proposal, `chrono::naive` is
retained as we had `TsSeconds` types duplicated for `NaiveDateTime`
and `DateTime` (legitimately).
2017-06-21 14:03:49 +09:00
Kang Seonghoon
388c04002b
Bumped the version number. This marks the beginning of 0.4.0 series.
- Added a mention to Chrono-tz.
2017-06-21 03:27:46 +09:00
Kang Seonghoon
52de957c60
I forgot to update the README and docs link (whoops).
Fixes #149.
2017-05-11 01:50:19 +09:00
Frans Skarman
5d07a5d9c1 Update code snippets to use syntax highlighting 2017-04-10 22:24:32 +02:00
Eric Findlay
3d36feb234 Corrected spelling error 2017-02-20 16:04:32 +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
Kang Seonghoon
0ac41c70b1
Minor additions to formatting items.
- Formatting item types are no longer `Copy`.

- `Numeric` and `Fixed` items now have `Internal` variants reserved
  for the future expansion. It had been hard to expand the items
  without totally breaking the backward compatibility (as per
  the API evolution guideline of RFC 1105).

- `Item::Owned{Literal,Space}` for the owned variant of
  `Item::{Literal,Space}` has been added.

Closes #76.
2017-02-07 04:05:05 +09:00
Kang Seonghoon
c63ef14734
time::Duration is no longer the sole duration type described.
Due to the backward compatibility we won't be going to remove support
for `time::Duration` in 0.3, and the initial 0.3.0 release won't have
proper `std::time::Duration` support (haven't finalized the logics).
However we will reserve proper names and signatures for the upcoming
`std::time::Duration` support---the "older" duration type will be
referred as "signed" in the names.

- Added a `chrono::prelude` module. This does not have the (old)
  `Duration` type reexported, so the documentation has now correctly
  replaced all occurrences of `chrono::Duration`. The existing
  `chrono::Duration` reexport itself remains for the compatibility.

- Avoided using a plain `Duration` type in the signature, to avoid
  any ambiguity.

- Renamed `checked_{add,sub}` to `checked_{add,sub}_signed`.

- Subtraction operator between two instants has been removed and
  replaced with `signed_duration_since`. This follows the naming
  chosen by `std::time::SystemTime` etc., and the version for newer
  `std::time::Duration` will be named to `duration_since`.
2017-02-06 09:39:32 +09:00
Kang Seonghoon
de4df91421
Removed all remaining mentions of rust-chrono (very old name). 2017-02-06 06:15:57 +09:00
Kang Seonghoon
04fd1413a8
Chrono is now under the Chronotope org; switch to docs.rs.
All CI accounts are now moved to the new organization (unfortunately
Appveyor does not automatically move the build history though).

Since it's a mess to redirect everything to chronotope.github.io,
I've taken this as an opportunity to switch to docs.rs---this seems
to be better than the manual management nowadays.

Updated other files as accordingly.
2017-02-06 05:49:32 +09:00
Kang Seonghoon
8aa1f4b7af
Further tweaks to CI configs.
- Do not doc-test three times in Travis, it simply takes a lot :(

- Forgot that Windows shell doesn't recognize single quotes.
2016-08-17 03:18:12 +09:00
Kang Seonghoon
eda83ac3d9
Tweaked Travis settings and tried to enable Appveyor CI. 2016-08-17 03:05:44 +09:00
Kang Seonghoon
cb9fd7fbe1 0.2.25: Fixed warnings from 0.2.24. Duh. 2016-08-04 03:44:31 +09:00
Kang Seonghoon
603ac1bc1c 0.2.24: Serialization updates.
- Serde 0.8 is now supported. (#86)

- The deserialization implementation for rustc-serialize now properly
  verifies the input. Also tons of tests have been added. (#42)
2016-08-04 03:37:33 +09:00
Kang Seonghoon
ae9be4a6f3 0.2.23: Documentation and minor bug fixes.
- Tons of documentation updates! (#77, #78, #80, #82 and my own
  changes as well)

- `DateTime::timestamp_subsec_{millis,micros,nanos}` methods have
  been added. (#81)

- When the system time records a leap second,
  the nanosecond component was mistakenly reset to zero. (#84)

- `Local` offset misbehaves in Windows for August and later,
  due to the long-standing libtime bug (dates back to mid-2015).
  Workaround has been implemented. (#85)
2016-08-03 01:18:33 +09:00
Kang Seonghoon
932e29aa94 Better documentation and cross-references for naive types. 2016-08-01 01:02:32 +09:00