Skip to content

Commit 08ce6ca

Browse files
committed
fix: set proper month from google forms
1 parent 37645e1 commit 08ce6ca

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

src/domain/google_sheet.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,14 @@ impl GoogleSheet {
8484
.collect::<Result<Vec<_>, _>>()
8585
.map_err(|_| format!("Invalid number in: {}", input))?;
8686

87+
if !(0..=11).contains(&nums[1]) {
88+
return Err(format!("Invalid month: {}", nums[1]));
89+
}
90+
91+
let month = (nums[1] + 1) as u32;
92+
8793
Ok(match nums.len() {
88-
3 => (nums[0], nums[1] as u32, nums[2] as u32, 0, 0, 0),
94+
3 => (nums[0], month, nums[2] as u32, 0, 0, 0),
8995
6 => (
9096
nums[0],
9197
nums[1] as u32,

0 commit comments

Comments
 (0)