mirror of
https://github.com/seigler/dash-docs
synced 2025-07-27 01:36:13 +00:00
Rename and validate utcoffset variable
This commit is contained in:
parent
042cfff6fd
commit
9792c3b582
1 changed files with 3 additions and 2 deletions
|
@ -48,7 +48,7 @@ module Jekyll
|
|||
next if !m.has_key?('event_url') or ( !m['event_url'].is_a?(String) and !m['event_url'].is_a?(Integer) and !m['event_url'].is_a?(Float) )
|
||||
# Assign variables
|
||||
time = m['time'].to_s
|
||||
utfoffset = m['utc_offset'].to_s
|
||||
utcoffset = m['utc_offset'].to_s
|
||||
title = m['group']['name'].to_s
|
||||
venue = m['venue']['name'].to_s
|
||||
address = m['venue']['address_1'].to_s
|
||||
|
@ -59,6 +59,7 @@ module Jekyll
|
|||
lon = m['venue']['lon'].to_s
|
||||
# Skip meetups with malformed data
|
||||
next if !/^[0-9]{1,15}$/.match(time)
|
||||
next if !/^-?[0-9]{1,10}$/.match(utcoffset)
|
||||
next if !/^.{1,150}$/.match(title)
|
||||
next if !/^.{1,150}$/.match(venue)
|
||||
next if !/^.{1,150}$/.match(address)
|
||||
|
@ -69,7 +70,7 @@ module Jekyll
|
|||
next if !/^-?[0-9]{1,3}(\.[0-9]{1,15})?$/.match(lon) or ( lon.to_f < -180 and lon.to_f > 180 )
|
||||
next if lon.to_f == 0 and lat.to_f == 0
|
||||
# Format variables
|
||||
time = Time.at((time.to_i + utfoffset.to_i) / 1000)
|
||||
time = Time.at((time.to_i + utcoffset.to_i) / 1000)
|
||||
time.utc
|
||||
date = time.year.to_s + '-' + time.month.to_s.rjust(2,'0') + '-' + time.day.to_s.rjust(2,'0')
|
||||
country = country.upcase
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue