lib/sportdb/utils.rb in sportdb-1.7.4 vs lib/sportdb/utils.rb in sportdb-1.7.5
- old
+ new
@@ -259,10 +259,15 @@
logger.debug " date: >#{value}<"
## todo: lets you configure year
## and time zone (e.g. cet, eet, utc, etc.)
- line.sub!( regex_de4, '[DATE.DE4]' )
+ ### NOTE: needs a trailing space
+ # not if regex ends w/ whitespace e.g. /s+
+ # make sure sub! adds a space at the end
+ # e.g. '[DATE.DE4]' becomes '[DATE.DE4] '
+
+ line.sub!( regex_de4, '[DATE.DE4] ' )
return DateTime.strptime( value, '%Y-%m-%d %H:%M' )
elsif line =~ regex_en
value = '%d-%s-%02d %02d:%02d' % [$3.to_i, $2, $1.to_i, $4.to_i, $5.to_i]
logger.debug " date: >#{value}<"