0

I am using the DateBox2 PlugIn for my jQuery Mobile webpage.

I get a duration in seconds from a JSON Webservice which can be as long as multiple days (e.g. 86400s).

I want to post this in to my text input using the standard DateBox2 duration display like "1 Day, 00:00:00", but all I get is the plain seconds value.

I tried some combinations of .val(), .datebox("setTheDate", 86400), .datebox(callFormat, ...) but none of them seem to work.

Here is my input field:

<input class='period' type='text' readonly='readonly' data-role='datebox' data-options='{"mode": "durationbox", "showInitialValue": true, "useFocus": true}' />

Thanks in advance!

1 Answer 1

1

Kindly use this:

$('element').trigger('datebox', {'method':'dooffset', 'type':'s', 'amount':86400}).trigger('datebox', {'method':'doset'});

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.