# Midnight at 00:00 not making sense - looking for ideas and suggestions

**URL:** <https://www.ruby-forum.com/t/midnight-at-00-00-not-making-sense-looking-for-ideas-and-suggestions/137638>\
**Category:** Rails\
**Created:** [May 14, 2008, 11:01pm UTC](https://www.ruby-forum.com/t/midnight-at-00-00-not-making-sense-looking-for-ideas-and-suggestions/137638 "2008-05-14T23:01:37Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![leethal](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/e99b99/32.png) [@leethal](https://www.ruby-forum.com/u/leethal)\
**Post date:** [May 14, 2008, 11:01pm UTC](https://www.ruby-forum.com/t/midnight-at-00-00-not-making-sense-looking-for-ideas-and-suggestions/137638/1 "2008-05-14T23:01:37Z")

</div>

Fiddling with a simple booking system for a music venue. The people  
working on that venue starts working at 17:00-ish at one day, and is  
finished 03:00-04:00. For a maintainer of the calendar, saying that  
something happens on May 19th at 01:00 when it actually happens on May  
20th at 01:00, makes sense.

Any ideas and suggestions on how to implement this kind of thing and  
keep everything smooth, sexy and DRY?

(Yes, that’s a vague question, so I’m looking for overall ideas and  
suggestions, not funky app-specific details)

---

<div class="post-metadata">

**Author:** ![leethal](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/e99b99/32.png) [@leethal](https://www.ruby-forum.com/u/leethal)\
**Post date:** [May 14, 2008, 11:03pm UTC](https://www.ruby-forum.com/t/midnight-at-00-00-not-making-sense-looking-for-ideas-and-suggestions/137638/2 "2008-05-14T23:03:59Z")

</div>

Answering myself for the win.

This - [Hey there, time traveller! | Filament Group, Inc.](http://www.filamentgroup.com/examples/slider/index2.php) looks  
pretty sexy. A sensible time input for this particular case. As for  
viewing it, doing some fancy sort by with a modulo should work,  
setting the “midnight” of the calendar view to 05:00 or something.

calendar\_events.sort\_by {|e| (e.time\_and\_date - 16.hours).hour % 24 }
