clede / Radiotrack

A Django web app to track live air times of your favorite radio programs.
Apache License 2.0
0 stars 0 forks source link

Update day_string code to handle ranges properly #2

Closed clede closed 7 years ago

clede commented 8 years ago

Update models.Program.save() to generate day_strings which properly handle ranges. e.g. if user has checked mon, tue, wed, fri, sat, sun: day_string should be: 'Mon-Wed, Fri-Sun'

('Mon-Fri' [weekdays], and 'Sat-Sun' [weekends] are already handled.)

(Maybe we just need to make a helper function, and get all this out of the save() method.)

clede commented 7 years ago

Completed, by way of helper function "get_streaks()" and helper method "set_day_strings()"

(There's probably still a better way to do this.)