Hello everyone,
I'm new here, this is my first post. After a search on google and this forum I couldn' find what I'm looking for.
I was searching about conversions "hh:mm" to seconds and vice-versa.
In my situation I have only one field on the DB. Called duration_in_seconds
But I don't want my users to calculate theyr seconds so I have 2 fields:
Starting Hour
Finishing Hour
This information is sent to the controller and it's model calculates the seconds.
Still I need to SHOW to the user the result in seconds in another field (not inputable) just to show them how many seconds they've spent on a task.
I know: Why the hell users need to see this?
But you guys know, sometimes they just want it and nothing will take it of theyr heads.
Here is something I found in this forum:
It wasn't exactly like this I've change to fit my needs.
The original code was posted by Diancecht while helping DoctorGonzo with timespan -> minutes
About my problem:
I found also something about using input:focus but it seems to not work with IE, any idea of a cross-browser solution?
Thank you guys. And if someone wants to know about the project I'm working: redmine.org
I'm learning JS CSS and Ruby/Ruby on Rails and trying to find something to contribute with redmine, I'm entering in the world of open source software
Cheers
I'm new here, this is my first post. After a search on google and this forum I couldn' find what I'm looking for.
I was searching about conversions "hh:mm" to seconds and vice-versa.
In my situation I have only one field on the DB. Called duration_in_seconds
But I don't want my users to calculate theyr seconds so I have 2 fields:
Starting Hour
Finishing Hour
This information is sent to the controller and it's model calculates the seconds.
Still I need to SHOW to the user the result in seconds in another field (not inputable) just to show them how many seconds they've spent on a task.
I know: Why the hell users need to see this?
But you guys know, sometimes they just want it and nothing will take it of theyr heads.
Here is something I found in this forum:
Code:
function timeSpanToInteger(tmspan) {
var fieldArray = tmspan.split(":");
return parseint(fieldArray[0])*60 + parseint(fieldArray[1]);
}
The original code was posted by Diancecht while helping DoctorGonzo with timespan -> minutes
About my problem:
I found also something about using input:focus but it seems to not work with IE, any idea of a cross-browser solution?
Thank you guys. And if someone wants to know about the project I'm working: redmine.org
I'm learning JS CSS and Ruby/Ruby on Rails and trying to find something to contribute with redmine, I'm entering in the world of open source software
Cheers