commit 4c4d18d0a055971a0fe5cfdeca2f88d6c081008a
parent f10c3f55659dba51de00a5d4814171df46d15880
Author: Alex Balgavy <a.balgavy@gmail.com>
Date: Fri, 13 Jan 2017 15:27:32 +0100
Update Cafeteria Purchase Formatter
Added a dash as separator to dates in purchase formatter
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/cafeteria_purchase_formatter.rb b/cafeteria_purchase_formatter.rb
@@ -10,7 +10,7 @@ lines.each do |text|
replace=text.gsub(/(^.+)[A|P]M/,'\1')
replace=replace.gsub(/(\d{4})\sat\s\d{2}:\d{2},(.*$)/,'\1,\2')
arr = replace.scan(/\w+\s\d{1,2},\s\d{4}/)
- ar2 = arr.map { |e| DateConverter.verbal_date_to_numeric(e) }
+ ar2 = arr.map { |e| DateConverter.verbal_date_to_numeric(e,'-') }
arr.each_with_index {|e,i| replace = replace.gsub(e,ar2[i])}
newlines << replace