From: Paul Hänsch Date: Fri, 1 Dec 2023 11:33:06 +0000 (+0100) Subject: fix from copy/paste X-Git-Url: https://git.plutz.net/?a=commitdiff_plain;h=e8bb1b01953d6035beb3db1d038d74b722f50702;p=invoices fix from copy/paste --- diff --git a/datetime.sh b/datetime.sh index 3021895..f90e74a 100644 --- a/datetime.sh +++ b/datetime.sh @@ -8,13 +8,11 @@ isdate(){ then # y-m-d (ISO Date) y="${date%%-*}" d="${date##*-}" m="${date%-*}" m="${m#*-}" elif printf %s "$date" \ - | grep -xEq '((0?1|0?3|0?5|0?7|0?8|10|12)/(0?[1-9]|[12][0-9]|3[01])|(0?4|0?6|0?9|11)/(0?[1-9]|[12][0-9]|30)|0?2-(0[1-9]|[12][0-9]))/([0-9]{2}|[0-9]{4 -})' + | grep -xEq '((0?1|0?3|0?5|0?7|0?8|10|12)/(0?[1-9]|[12][0-9]|3[01])|(0?4|0?6|0?9|11)/(0?[1-9]|[12][0-9]|30)|0?2-(0[1-9]|[12][0-9]))/([0-9]{2}|[0-9]{4})' then # m/d/y (US Date) y="${date##*/}" m="${date%%/*}" d="${date%/*}" d="${d#*/}" elif printf %s "$date" \ - | grep -xEq '((0?[1-9]|[12][0-9]|3[01])[\./](0?1|0?3|0?5|0?7|0?8|10|12)|(0?[1-9]|[12][0-9]|30)[\./](0?4|0?6|0?9|11)|(0[1-9]|[12][0-9])[\./]0?2)[\./]( -[0-9]{2}|[0-9]{4})' + | grep -xEq '((0?[1-9]|[12][0-9]|3[01])[\./](0?1|0?3|0?5|0?7|0?8|10|12)|(0?[1-9]|[12][0-9]|30)[\./](0?4|0?6|0?9|11)|(0[1-9]|[12][0-9])[\./]0?2)[\./]([0-9]{2}|[0-9]{4})' then # d/m/y or d.m.y (European Date / German Date) y="${date##*.}" d="${date%%.*}" m="${date%.*}" m="${m#*.}" else