I'd like a clever way to handle this in all my code from now on.
I have some existing methods that do date calculations in apex...some use the businessHours object and some don't. Many surface results to visualforce pages and work nicely.
When I retrieve them by jsRemoting, I get back javascript date, which is really date time. So if my apex date is 4/5/2013, I'm getting back 4/4/2013 at 6pm...it like it took the apex date at midnight (start of the day) and timeline shifted it for US central time (my locale).
It gets even uglier when I have to validate do jquery mobile html form stuff...so I'm converting that date time in JS to a string to prepopulate a form field. Then depending on what the user enters, I have to validate it against a min/man date from apex...and I'm dealing with the date being ok, but depending on what times are entered, the hours being not ok.
Is there a way to "fix" what comes back from apex? Or am I better off doing all this on the client side? JS date manipulation is not as elegant as apex.