aboutsummaryrefslogtreecommitdiff
path: root/src/views.rs
diff options
context:
space:
mode:
authorAkshay <[email protected]>2020-07-14 12:50:36 +0100
committerAkshay <[email protected]>2020-07-14 12:50:36 +0100
commit3ded40d04f49983e7907366536dbc94917cee666 (patch)
tree5e837246e3603249c9a7e4343d1afb762d5d0e71 /src/views.rs
parent68ebbd1f753e0937bfaf07006daf1d6144c21bed (diff)
more boilerplate for auto-trackable habits
add funding.yml also :^)
Diffstat (limited to 'src/views.rs')
-rw-r--r--src/views.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/views.rs b/src/views.rs
index 9e4a844..54d5431 100644
--- a/src/views.rs
+++ b/src/views.rs
@@ -63,7 +63,7 @@ where
63 }, 63 },
64 ); 64 );
65 65
66 let draw_month = |printer: &Printer| { 66 let draw_week = |printer: &Printer| {
67 let days = (1..31) 67 let days = (1..31)
68 .map(|i| NaiveDate::from_ymd_opt(year, month, i)) 68 .map(|i| NaiveDate::from_ymd_opt(year, month, i))
69 .flatten() // dates 28-31 may not exist, ignore them if they don't 69 .flatten() // dates 28-31 may not exist, ignore them if they don't
@@ -77,10 +77,10 @@ where
77 let bars_to_fill = (completions * full as u32) / weekly_goal; 77 let bars_to_fill = (completions * full as u32) / weekly_goal;
78 let percentage = (completions as f64 * 100.) / weekly_goal as f64; 78 let percentage = (completions as f64 * 100.) / weekly_goal as f64;
79 printer.with_style(future_style, |p| { 79 printer.with_style(future_style, |p| {
80 p.print((4, line_nr), &"�".repeat(full)); 80 p.print((4, line_nr), &"��".repeat(full));
81 }); 81 });
82 printer.with_style(goal_reached_style, |p| { 82 printer.with_style(goal_reached_style, |p| {
83 p.print((4, line_nr), &"�".repeat(bars_to_fill as usize)); 83 p.print((4, line_nr), &"��".repeat(bars_to_fill as usize));
84 }); 84 });
85 printer.with_style( 85 printer.with_style(
86 if is_this_week { 86 if is_this_week {
@@ -120,7 +120,7 @@ where
120 120
121 match self.view_mode() { 121 match self.view_mode() {
122 ViewMode::Day => draw_day(printer), 122 ViewMode::Day => draw_day(printer),
123 ViewMode::Week => draw_month(printer), 123 ViewMode::Week => draw_week(printer),
124 _ => draw_day(printer), 124 _ => draw_day(printer),
125 }; 125 };
126 } 126 }