aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Lemon <y@yulqen.org>2024-12-12 14:14:11 +0000
committerMatthew Lemon <y@yulqen.org>2024-12-12 14:14:11 +0000
commit7b618420b240755b836f2ff53967d61ec6b70904 (patch)
tree5c7e8a36ecff17368af0d365cafb42255aeebb7d
parentc75080fd3a563891256751effe552e7721cb906e (diff)
Adding stuff
-rwxr-xr-xtjp.sh21
1 files changed, 21 insertions, 0 deletions
diff --git a/tjp.sh b/tjp.sh
index 8b6eaa7..42f671d 100755
--- a/tjp.sh
+++ b/tjp.sh
@@ -38,6 +38,13 @@ list_personal_entries() {
psql -h "$HOST" -U "$USER" -d "$DB" -c "SELECT id, date_added, entry, comment FROM journal_entries WHERE type = 2;"
}
+# Funtion to list personel entries by date
+list_personal_entries_on_date() {
+ echo "Enter meeting date (YYYY-MM-DD):"
+ read target_date
+ psql -h "$HOST" -U "$USER" -d "$DB" -c "SELECT id, entry, date_added::DATE from journal_entries WHERE date_added::date = '$target_date' AND type = 2;"
+}
+
# Function to select all MOD entries
# list_MOD_entries() {
# psql -h "$HOST" -U "$USER" -d "$DB" -c "\x" -c "SELECT * FROM journal_entries WHERE type = 1;"
@@ -46,6 +53,12 @@ list_MOD_entries() {
psql -h "$HOST" -U "$USER" -d "$DB" -c "\x" -c "SELECT id, date_added, entry, comment, meeting_id FROM journal_entries WHERE type = 1;"
}
+# Funtion to list MOD entries by date
+list_MOD_entries_on_date() {
+ echo "Enter meeting date (YYYY-MM-DD):"
+ read target_date
+ psql -h "$HOST" -U "$USER" -d "$DB" -c "SELECT id, entry, date_added::DATE from journal_entries WHERE date_added::date = '$target_date' AND type = 1;"
+}
# Function to list all MOD contacts
list_MOD_contacts() {
@@ -93,9 +106,15 @@ case "$1" in
-l)
list_personal_entries
;;
+ -L)
+ list_personal_entries_on_date
+ ;;
-M)
list_MOD_entries
;;
+ -D)
+ list_MOD_entries_on_date
+ ;;
-F)
list_MOD_meetings
;;
@@ -116,7 +135,9 @@ case "$1" in
echo " tjp -C - Add MOD contact"
echo " tjp -Y - Select all MOD contacts"
echo " tjp -l - Select all personal entries"
+ echo " tjp -L - Select personal entries by date"
echo " tjp -M - Select all MOD entries"
+ echo " tjp -D - Select MOD entries on date"
echo " tjp -F - Select all MOD meetings"
echo " tjp -e - Add new meeting (returns meeting ID)"
echo " tjp -E ID - Add new journal entry for meeting whose ID is ID"