|
Comments and Discussions
|
 |
 |
Hello, This is very nice & helpful code written by you but can someone tell me, how could I convert "00:00:05.1243" or "00:00:05" to TimeStamp. I am getting above value using Jquery Post method from c# code as string. Thanks, Atul Rungta +91-9879662225 @*{Save Paper - Save Trees}*@
|
|
|
|
 |
All of your class methods should be prototyped. The way it is now, every instance of a DateTime class will carry around it's own copies of the functions in memory.
function DateTime() {
}
DateTime.prototype = {
add: function() {
},
addDays: function() {
} };
|
|
|
|
 |
Great, thanks. But one question:
I've modified the code to work that way, but when calling things, I can't reference an instance property. Like
function DateTime(){
this.foo = 123;
}
DateTime.prototype = {
something: function(){
this.foo; alert(foo); }
}
So, how can I access the foo property of the DateTime instance?
|
|
|
|
 |
This works fine.
function DateTime(){
this.foo = 123;
}
DateTime.prototype = {
something: function(){
alert(this.foo);
}
}
var d = new DateTime();
d.something();
|
|
|
|
 |
Never mind. Solved.
Thanks a lot for the thing I learned today.
|
|
|
|
 |
Good. Glad you got it working.
|
|
|
|
 |
Thank you for your great contribution! However, DateTime.now() is not working properly. Also, will you implement a string parser?
modified 13-May-14 18:04pm.
|
|
|
|
|
 |
|
General News Suggestion Question Bug Answer Joke Rant Admin
Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.
|
First Posted | 3 Mar 2010 |
Views | 43,869 |
Downloads | 924 |
Bookmarked | 28 times |
|
|