Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
hoursMins: (quarters) ->
addLeadingZero: (n) ->
if n.toString().length is 1 then "0$n" else "$n"
hours: addLeadingZero( Math.floor( quarters / 4))
mins: addLeadingZero( quarters*15 - hours * 60)
"$hours:$mins"
addSlider: () ->
$("#slider-range").slider {
range: true,
min: 0,
max: 96,
values: [32, 88],
slide: (event, ui) ->
$("#amount").val(hoursMins(ui.values[0]) + ' - ' + hoursMins(ui.values[1]))
}
$("#amount").val('$' + $("#slider-range").slider("values", 0) + ' - $' + $("#slider-range").slider("values", 1))
$(addSlider())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.