We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 956613f commit c5c6bf6Copy full SHA for c5c6bf6
git-date/src/parse.rs
@@ -118,10 +118,11 @@ mod relative {
118
let seconds: i64 = match period {
119
"second" => 1,
120
"minute" => 60,
121
- "hour" => 3_600,
122
- "day" => 86_400,
123
- "week" => 604_800,
124
- // TODO months & years?
+ "hour" => 60 * 60,
+ "day" => 24 * 60 * 60,
+ "week" => 7 * 24 * 60 * 60,
+ // TODO months & years? YES
125
+ // Ignore values you don't know, assume seconds then (so does git)
126
_ => return None,
127
};
128
seconds.checked_mul(multiplier).map(Duration::seconds)
0 commit comments