0

我正在为我的 jQuery Mobile 网页使用 DateBox2 插件。

我从 JSON Webservice 获得持续时间(以秒为单位),该持续时间可能长达数天(例如 86400 秒)。

我想使用标准 DateBox2 持续时间显示(如“1 天,00:00:00”)将其发布到我的文本输入中,但我得到的只是普通的秒值。

我尝试了 .val()、.datebox("setTheDate", 86400)、.datebox(callFormat, ...) 的一些组合,但它们似乎都不起作用。

这是我的输入字段:

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

提前致谢!

4

1 回答 1

1

请使用这个:

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

于 2013-09-24T04:41:40.237 回答