Browse Source

Minor fixes. Added example. Updated readme.

dev
frnmst/Franco Masotti 5 years ago
parent
commit
2acdf90d6d
  1. 19
      README.md
  2. 56
      example.txt
  3. 4
      monthly_attendace_paper.sh

19
README.md

@ -17,7 +17,12 @@ Optionally, to print the template:
- [CUPS](http://www.cups.org/)
or whatever printing system is able to print from the
standard input
standard input.
## Example
See [example.txt](example.txt) for an example printout. Note
that the example was made to test a leap year.
## Configuration
@ -34,7 +39,7 @@ Important variables are:
as well as the days of the week, which you can translate in
your language.
You can also edit the date formats in the following functions:
You can also edit the date formats in the following script functions:
get_full_string()
print_day()
@ -49,6 +54,16 @@ You can also edit the date formats in the following functions:
## Warning
This script heavily depends on tabs for formatting. What you see
in a printout may be different to what you see on the screen;
what you see on an editor after executing:
$ ./monthly_attendace_paper.sh > printout.txt
might be different than:
$ ./monthly_attendace_paper.sh
This script does not check any input nor output for errors.
That's up to you.

56
example.txt

@ -0,0 +1,56 @@
Monthly attendance paper printout
Employer: THE EMPLOYER
Employee: THE EMPLOYEE
Month and Year: 02 2012
1/02 Wednesday 15/02 Wednesday
2/02 Thursday 16/02 Thursday
3/02 Friday 17/02 Friday
4/02 Saturday 18/02 Saturday
||5/02 Sunday|| ||19/02 Sunday||
6/02 Monday 20/02 Monday
7/02 Tuesday 21/02 Tuesday
8/02 Wednesday 22/02 Wednesday
9/02 Thursday 23/02 Thursday
10/02 Friday 24/02 Friday
11/02 Saturday 25/02 Saturday
||12/02 Sunday|| ||26/02 Sunday||
13/02 Monday 27/02 Monday
14/02 Tuesday 28/02 Tuesday
29/02 Wednesday
Format: "Date/Month Day Worked Hours / Entry time - Exit time"

4
monthly_attendace_paper.sh

@ -52,9 +52,9 @@ fi
is_leap_year="false"
if [ $(($this_year % 4)) -ne 0 ]; then
is_leap_year="false"
elif [ $(($this_year % 100)) -ne 0]; then
elif [ $(($this_year % 100)) -ne 0 ]; then
is_leap_year="true"
elif [ $(($this_year % 400)) -ne 0]; then
elif [ $(($this_year % 400)) -ne 0 ]; then
is_leap_year="false"
else
is_leap_year="true"