Download latest version
add this line to your composer.json
"russ666/yii2-countdown": "*"
echo \russ666\widgets\Countdown::widget([
'id' => 'some-id',
'datetime' => date('Y-m-d H:i:s O', time() + 1000),
'format' => '\<span style=\"background: red\"\>%M</span>:%S',
'tagName' => 'span',
'events' => [
'finish' => 'function(){location.reload()}',
],
])
Container id.
Datetime string to countdown. Must be added with timezone, to prevent client-server timezone difference issue.
Datetime format for widget (http://hilios.github.io/jQuery.countdown/documentation.html#formatter)
Widget events (http://hilios.github.io/jQuery.countdown/documentation.html#events)
Container html options.
Container tag name.
Homepage - http://hilios.github.io/jQuery.countdown