Commit Graph

57 Commits

Author SHA1 Message Date
Wolfgang Bumiller
0652d81977 tree-wide: enable doc_cfg and doc_auto_cfg for docs
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-07-02 11:59:53 +02:00
Wolfgang Bumiller
bb8460bc0f time: bump to 2.0.0-1
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-06-20 13:49:56 +02:00
Wolfgang Bumiller
214dbdf9a5 time: remove deprecated functions
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-06-20 13:48:42 +02:00
Wolfgang Bumiller
533954ed38 bump bitflags dependency to 2.4
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-06-20 13:48:32 +02:00
Wolfgang Bumiller
1c5f27014c time: drop TryFrom/TryInto imports
they're in the prelude by now

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-06-19 14:55:41 +02:00
Shannon Sterz
a4be52d4a6 time: exclude certain use statements and impl block on wasm32
otherwise the compiler will complain that they aren't used when
compiling the code for wasm32.

Signed-off-by: Shannon Sterz <s.sterz@proxmox.com>
2024-06-19 14:55:41 +02:00
Lukas Wagner
5cbc8a4b66 add proxmox-rrd to workspace
Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
2024-02-01 10:30:57 +01:00
Wolfgang Bumiller
ea05268cde bump proxmox-time to 1.1.6
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-01-08 12:18:12 +01:00
Lukas Wagner
1384bd9161 time: posix: add epoch_to_rfc2822
This is the format used in the 'Date' header in mails.

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
2024-01-08 12:04:11 +01:00
Lukas Wagner
795b3a57a7 time: posix: add bindings for strftime_l
This variant of strftime can be provided with a locale_t, which
determines the locale used for time formatting.

A struct `Locale` was also introduced as a safe wrapper around
locale_t.

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
2024-01-08 11:59:26 +01:00
Lukas Wagner
5b25e7cc90 time: posix: inline vars in string formatting
No functional changes.

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
2024-01-08 11:57:25 +01:00
Lukas Wagner
7033c497a0 time: posix: use strftime from the libc crate.
Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
2024-01-08 11:57:15 +01:00
Dietmar Maurer
c1819c2549 DailyDuration: derive PartialEq (for GUI)
Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2023-10-20 12:01:27 +02:00
Dominik Csapak
299a478f15 proxmox-time: implement epoch_to_rfc3339 for wasm
we just printed out the UTC version, this implements a localized version

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2023-08-30 09:20:38 +02:00
Dominik Csapak
151e2cfdfd time: make RFC3339 format in wasm conform to usual format
on other targets we print the timestamp without fractional seconds
('.xxxZ'), so we should remove that too on wasm

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2023-08-30 09:18:44 +02:00
Lukas Wagner
5ea70421b3 clippy fix: casting to the same type is unnecessary
See: https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
2023-08-08 11:48:01 +02:00
Wolfgang Bumiller
8f8d52f148 update d/copyright files to debian copyright-format 1.0
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2023-05-23 13:02:39 +02:00
Wolfgang Bumiller
2cebe420c1 bump proxmox-time to 1.1.5-1
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2023-01-12 14:23:11 +01:00
Dietmar Maurer
78e86f3261 re-add epoch_to_rfc3339_utc on wasm target
This was lost in commit 980d6b26df.

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2022-12-15 13:35:53 +01:00
Fabian Grünbichler
de6a59289a proxmox-time: drop TryFrom use statement
no longer needed with edition 2021

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2022-12-07 09:48:47 +01:00
Fabian Grünbichler
6c161bd5ab update d/control files
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2022-12-07 09:48:38 +01:00
Fabian Grünbichler
4189221470 inherit shared, external dependencies
noteworthy changes:
- proxmox-http had a default_features_false dep on hyper, which is dropped (the
  default feature is empty anyway)
- hyper, libc, nix, tokio and url versions are unified
- missing (cosmetic) bindgen feature on zstd enabled everywhere

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2022-12-07 09:48:38 +01:00
Fabian Grünbichler
64959d9ae0 move common metadata to workspace
and switch all crates to 2021 edition as well as a unified "authors" value.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2022-12-07 09:48:25 +01:00
Fabian Grünbichler
5ec765f842 update d/control files
debcargo 2.6 changed some minor details

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2022-12-06 11:21:43 +01:00
Fabian Grünbichler
28e30719e8 clippy fixes
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2022-10-11 09:48:04 +02:00
Fabian Grünbichler
9478ae2bed fixup! time: update to nom 7 2022-08-19 14:19:39 +02:00
Fabian Grünbichler
1344ffdd94 time: bump to 1.1.4
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2022-08-19 12:22:45 +02:00
Fabian Grünbichler
552f14e916 time: update to nom 7
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2022-08-19 12:22:27 +02:00
Wolfgang Bumiller
1fca7b715d time: clippy fixes
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-06-29 10:06:20 +02:00
Fabian Grünbichler
980d6b26df proxmox-time: add missing 1.1.3 change
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2022-06-02 14:33:12 +02:00
Thomas Lamprecht
9c0e9dca59 tree wide update of genereated control
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-05-05 10:22:50 +02:00
Dietmar Maurer
47c9bed30d impl epoch_to_rfc3339_utc on wasm target 2022-04-20 09:10:47 +02:00
Thomas Lamprecht
4554034d32 time: rustfmt
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-04-10 12:34:04 +02:00
Wolfgang Bumiller
b28f0d820b time: fix tests
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-12-17 08:04:12 +01:00
Dietmar Maurer
165fa05290 Allow to compile on wasm32 target
Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2021-12-03 08:52:54 +01:00
Dietmar Maurer
259e4b1441 update proxmox-time to version 1.1.2-1
Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2021-12-02 10:38:06 +01:00
Dominik Csapak
6bdf5085dc proxmox-time: calendar-events: parse 'UTC' timezone into calendarevent
like we do in pve. this breaks the (newly added) compute_next_event
method of CalendarEvent, but we can keep compatibilty with the
deprecated function

adapt the tests so that they add a ' UTC' by default
(so they can run reliably on any machine)

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2021-12-02 10:32:53 +01:00
Dietmar Maurer
63cecf8a69 bump proxmox-time version to 1.1.1-1
Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2021-12-01 07:18:44 +01:00
Dominik Csapak
c77ab2c7e5 proxmox-time: time-span: implement FromStr
and deprecate 'parse_time_span'

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2021-12-01 07:14:33 +01:00
Dominik Csapak
42420d3a5e proxmox-time: calendar_events: implement FromStr
and deprecate 'parse_calendar_event'

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2021-12-01 07:14:20 +01:00
Dominik Csapak
a96e9fb724 proxmox-time: calendar-events: make compute_next_event a method
and deprecated the standalone function

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2021-12-01 07:14:06 +01:00
Dominik Csapak
032787a6a3 proxmox-time: lib.rs: rustfmt
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2021-12-01 07:13:45 +01:00
Dominik Csapak
676146fd90 proxmox-time: move tests from time.rs to test.rs
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2021-12-01 07:13:36 +01:00
Dominik Csapak
22b3388500 proxmox-time: move TimeSpan into time_span.rs
and related parsing functions

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2021-12-01 07:13:23 +01:00
Dominik Csapak
6a680aac55 proxmox-time: move CalendarEvent into calendar_events.rs
and all relevant parsing functions as well

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2021-12-01 07:13:08 +01:00
Dominik Csapak
83cf350f04 proxmox-time: daily_duration.rs: rustfmt
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2021-12-01 07:12:51 +01:00
Dominik Csapak
78e1e8ce09 proxmox-time: move parse_daily_duration to daily_duration.rs
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2021-12-01 07:12:35 +01:00
Dominik Csapak
f61ee1372f proxmox-time: split DateTimeValue into own file
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2021-12-01 06:55:51 +01:00
Dominik Csapak
07cc21bd5a proxmox-time: move WeekDays into own file
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2021-12-01 06:55:32 +01:00
Dominik Csapak
a104c8fc41 proxmox-time: move common parse functions to parse_helpers
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2021-12-01 06:55:04 +01:00