Skip to content
This repository has been archived by the owner on Apr 3, 2018. It is now read-only.

Commit

Permalink
Fix #61
Browse files Browse the repository at this point in the history
  • Loading branch information
funilrys committed Jul 16, 2017
1 parent 44f23f1 commit ee8b214
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion funceble
Original file line number Diff line number Diff line change
Expand Up @@ -991,6 +991,8 @@ formatDate()
local regex29='[0-9]{2}-[A-Z]{1}[a-z]*-[0-9]{4}'
# Date in format: 2017-Jan-05.
local regex30='[0-9]{4}-[A-Z]{1}[a-z]{2}-[0-9]{2}\.'
# Date in format: Mon Jan 02 15:00:00 2017
local regex31='[a-zA-Z]{3}\s[a-zA-Z]{3}\s[0-9]{2}\s[0-9]{2}:[0-9]{2}:[0-9]{2}\s[0-9]{4}'

if [[ "${expirationDate}" =~ ${regex1} || "${expirationDate}" =~ ${regex26} ]]
then
Expand Down Expand Up @@ -1065,7 +1067,7 @@ formatDate()

# We assign the expiration date
expirationDate=${day}'-'${month}'-'${year}
elif [[ "${expirationDate}" =~ ${regex14} || "${expirationDate}" =~ ${regex15} ]]
elif [[ "${expirationDate}" =~ ${regex14} || "${expirationDate}" =~ ${regex15} || "${expirationDate}" =~ ${regex31} ]]
then
# We split the date
local day=$(echo "${expirationDate}" | tr -cd '[[:digit:]]' | head -c2)
Expand Down

0 comments on commit ee8b214

Please sign in to comment.