aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Lemon <matt@matthewlemon.com>2022-09-15 14:10:30 +0100
committerMatthew Lemon <matt@matthewlemon.com>2022-09-15 14:10:30 +0100
commitaca2a967db559e85f97ba7c8c6ed93a68e82e7c9 (patch)
tree20e6dbbc10e2dba66949ed6933ad891baa35d713
parentbba4bbff596ffec0b31b44d8e4b6040549ede3fa (diff)
the script puts disclaimer about being pre-generated on future dayplans
-rwxr-xr-xdayplan.pl13
1 files changed, 10 insertions, 3 deletions
diff --git a/dayplan.pl b/dayplan.pl
index 4faef36..24ae76a 100755
--- a/dayplan.pl
+++ b/dayplan.pl
@@ -12,6 +12,7 @@ my ($dt, $d, $y, $m, $weekday);
my @weekdays = qw(Monday Tuesday Wednesday Thursday Friday Saturday Sunday);
my $dayplans = '/home/lemon/Notes/journal/day_plans';
+#my $dayplans = '/tmp';
my $numargs = $#ARGV + 1;
@@ -42,7 +43,7 @@ if ($numargs == 1) {
$weekday = $weekdays[$dt->day_of_week - 1];
}
else {
- $dt = DateTime->now;
+ $dt = DateTime->today;
$d = $dt->day;
$m = $dt->month;
$y = $dt->year;
@@ -78,8 +79,9 @@ if (scalar @quicknotes == 0) {
$qnote_block = "@quicknotes"."from:"."\n"."@qfiles";
}
-
-my $template = "Goal for $weekday: [replace this with your goal]
+my $td = $dt->strftime('%Y-%m-%d');
+my $mname = $dt->month_name;
+my $template = "Goal for $weekday $d $mname $y: [replace this with your goal]
---
$qnote_block
@@ -105,6 +107,11 @@ if (-e $today_planner) {
{
open( FH, ">$today_planner");
print FH $template;
+ my $today = DateTime->today;
+ if ($today != $dt) {
+ printf (FH "\nNOTE: This dayplan was generated in advance on %d-%02d-%d. Reminders and quicknotes may not be up to date.", $today->year, $today->month, $today->day);
+ }
+
close FH;
exec("vim", "$today_planner");
}