# format any arguments as a string
date_args="$@"

# determine what directory notes should be written to
default_dir="~/docs/notes"
base_dir=$(if [ -z $NOTES ]; then echo "$default_dir"; else echo $NOTES; fi)

# generate the date format for the note file
note_format="$base_dir/%Y/%m/%d.md"

# determine the note file
note_file=$(date +"$note_format" --date "$date_args")
note_dir=$(dirname "$note_file")

# make the directory for the note and open it with $EDITOR
mkdir -p "$note_dir"
$EDITOR "$note_file"

I keep my notes in a version-controlled directory with each day's notes in a file formatted as YYYY/MM/DD.md.

I generate those note files with a shell script that gets the current (or otherwise specified) date and generates the appropriate directory before opening the file with my $EDITOR. That allows me to quickly run $SCRIPT to jot down some thoughts or $SCRIPT last friday to remember what I was doing last week.