This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'csv' | |
# Parses CSV-exported data from SleepBot | |
def parse_export(row) | |
# Parse the wake up date | |
date_to = row[0].tr("'","").split('-') | |
date_to = Time.new(date_to[2].to_i, date_to[1], date_to[0]) | |
# Parse the wake up/sleep times | |
time_from = row[1].tr("'","").split(':') |