1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
//! # JayVer
//!
//! A calendar versioning scheme for binaries developed by
//! [Emmett Jayhart](https://github.com/EmmettJayhart),
//! built upon ISO 8601 week dates and [CalVer](https://calver.org/).
//!
//! JayVer follows the format: **YY**.**WW**.**PATCH**
//!
//! - **YY**: ISO week-numbering year minus 2000 (e.g., `25` for 2025)
//! - **WW**: ISO 8601 week number (`1`-`53`)
//! - **PATCH**: Incremental number for patches within same week, starting at
//! `0`
//!
//! ## Examples
//!
//! ```
//! use jayver::Version;
//!
//! // Parse a version string
//! let version = Version::parse("25.16.3").unwrap();
//! assert_eq!(version.year, 25); // Year 2025 (25 + 2000)
//! assert_eq!(version.week, 16);
//! assert_eq!(version.patch, 3);
//!
//! // Create a version for the current date
//! let today = Version::today();
//! println!("Current version: {today}");
//!
//! // Compare versions
//! let v1 = Version::parse("25.10.0").unwrap();
//! let v2 = Version::parse("25.11.0").unwrap();
//! assert!(v1 < v2);
//!
//! // Check version requirements
//! use jayver::VersionReq;
//! let req = VersionReq::parse(">=25.10.0").unwrap();
//! assert!(req.matches(&v1));
//! ```
//!
//! ## ISO 8601 Week Dates
//!
//! JayVer strictly follows ISO 8601 week dates:
//! - Week 01 is the week containing January 4th
//! - Weeks are numbered 01-53
//! - The ISO week-numbering year may differ from the calendar year near year
//! boundaries
pub use crate::;
/// Quickly parse a version string without importing the Version type.
///
/// # Examples
///
/// ```
/// let version = jayver::parse("25.16.0").unwrap();
/// assert_eq!(version.to_string(), "25.16.0");
/// ```
/// Check if a version string is valid without constructing a Version.
///
/// # Examples
///
/// ```
/// assert!(jayver::is_valid("25.16.0"));
/// assert!(!jayver::is_valid("25.54.0")); // Week 54 is invalid
/// ```
/// Create a version representing the current date with patch 0.
///
/// # Examples
///
/// ```
/// let today = jayver::today();
/// println!("Today's version: {}", today);
/// ```