Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Input text format to 00:00:00 instead of 00.00 #20

Open
nagyervin89 opened this issue Aug 23, 2015 · 1 comment
Open

Input text format to 00:00:00 instead of 00.00 #20

nagyervin89 opened this issue Aug 23, 2015 · 1 comment

Comments

@nagyervin89
Copy link

Is it possible after document is ready the selected input $("#runner") text will be initialized like this 00:00:00.00 or 00:00:00 instead of 00.00 ?

@bees4ever
Copy link

bees4ever commented Jan 31, 2017

Yes, I also would like to have such a functionality. First it is also working with this function.

$('#time').runner({
        startAt:12034507,
        format:function(s,so)
        {
            var t = parseInt(s);
            var hour = Math.floor(t/3600000);
            t = t - hour*3600000;
            var min = Math.floor(t / 60000);
            t = t - min * 60000;
            var sec = Math.floor(t/1000);
            t = t - sec*1000;


            if(hour < 10)
            {
                hour="0"+hour;
            }
            if(min < 10)
            {
                min="0"+min;
            }
            if(sec < 10)
            {
                sec="0"+sec;
            }
            if(t < 10)
            {
                t="00"+t;
            }
            else if(t < 100)
            {
                t="0"+t;
            }

            return hour+":"+min+":"+sec+"."+t;

        }

});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants