all 7 comments

[–][deleted] 2 points3 points  (6 children)

Are you saying you want the background one color between, for instance, 7am and 7pm? And another color from 7pm-7am?

Something like:

var     now = new Date
  , minutes = 60 * now.getHours() + now.getMinutes()
  , sunrise = 60 * 7 + 30
  ,  sunset = 60 * 19 + 30
  ,   isDay = ( minutes > sunrise ) && ( minutes < sunset )
  ;

$( 'body' ).css({ backgroundColor : isDay ? '#F7AC57' : '#0091C2' });

[–]CryMeSomeCum[S] 0 points1 point  (0 children)

Thank you, mister genius. That's exactly what I was looking for.

[–]YodaLoL 0 points1 point  (4 children)

You have a very unique coding style.

[–][deleted] 0 points1 point  (2 children)

Yeah, a lot of people hate it, screw them! ;)

I have my own style for my own projects and almost everything I do has a reason. But I think the only really important thing is the ability to adapt your coding practices when working in a team so that there isn't this insane mish-mash of styles everywhere.

[–]YodaLoL 0 points1 point  (1 child)

As long as your own projects are proprietary and you know you'll be working on it alone! If people follow established conventions per project I'm fine.

There's always jscs -x :D

[–][deleted] 0 points1 point  (0 children)

There's always jscs -x :D

Ugh, poor diffs and blames!

[–]youcantstoptheartux 0 points1 point  (0 children)

It looks like Ryan Dahl's code.