Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Applying date/time functions to dates from SQL Server
Message
 
 
To
All
General information
Forum:
Javascript
Category:
Other
Title:
Applying date/time functions to dates from SQL Server
Miscellaneous
Thread ID:
01621493
Message ID:
01621493
Views:
49
Hi everybody,

In our MVC application the view model has 2 datetime? properties. In JavaScript I am trying the following code:
$scope.startTime = $scope.currentmax4sale.startTime.getHours() + ':' + $scope.currentmax4sale.startTime.getMinutes();
because I'd like to construct time only (in 'HH:MM') format from that date. But it's failing with a message that getHours() is not a function.

So, how should I get my time in the right format after I got my model values back? The date looks like

"2010-11-13T00:00:00"

Thanks in advance. If I try to apply new Date(...) function to that date, then it's converting it to my local time, which is not what I want. I want it to use that string as date and not apply any conversions.

UPDATE: I've decided to put the conversion inside the .NET ViewModel instead.
If it's not broken, fix it until it is.


My Blog
Next
Reply
Map
View

Click here to load this message in the networking platform