 	'</div>'
 
 WorkoutHeader = (headerText) ->
-	DATE_REGEXP = /(\d+\/\d+\/\d+)\s/
-	this._text = headerText
-	this._workoutDate = headerText.match(DATE_REGEXP)?[1]
+	txt = headerText
+	this._text = txt
+
+	this._workoutDate = getDate(txt)
+
+	this._workoutUnitOfWeight = getUnitOfWeight(txt)
+	console.log @_workoutUnitOfWeight
+
+	this._meta = WorkoutHeader.getMeta(txt)
+	console.log @_meta
+
 	this
 
 WorkoutHeader.prototype.isValid = () ->

	'<div class="workout-header">' +
		toHtml(this._text) +
	'</div>'

Exercises = (exercises) -> this


		text.join '<br>'
	else
		text.replace(/\n/g, '<br>')

chop = (text, textToChop) ->
	if typeof text is not 'string'
		text
	else
		text.replace(textToChop, '')

# Takes in text containing slash separated date e.g. 2015/03/01
# returns first date found as unix time
# returns null if no date found
# TODO: adjust for timezones
getDate = (text, context) ->
	WORKOUT_HEADER_DATE_REGEXP = /(\d+\/\d+\/\d+)\s/
	dateString = text.match(WORKOUT_HEADER_DATE_REGEXP)?[1]
	if !dateString
		null
	else
		dateString.replace(/\//g, '-')
		Date.parse(dateString)

# Takes in text containing unit of weight
# returns first unit of weight found
# returns user's default unit of weight if no date found
getUnitOfWeight = (text, context) ->
	if (text.contains('lbs') or text.contains('lb'))
		cfg.unitOfWeight.pounds
	else if (text.contains('kgs') or text.contains('kg'))
		cfg.unitOfWeight.kilos
	else
		cfg.unitOfWeight.DEFAULT

Workouts = (text) ->
	this._chunks = text.split(WORKOUT_SEPARATOR)
