russ666 / yii2-countdown
jQuery countdown widget for Yii2
Installs: 82 071
Dependents: 0
Suggesters: 0
Security: 0
Stars: 8
Watchers: 3
Forks: 5
Open Issues: 0
Type:yii2-extension
Requires
- bower-asset/jquery.countdown: *
- yiisoft/yii2: *
This package is not auto-updated.
Last update: 2024-04-13 13:50:34 UTC
README
download
Download latest version
composer
add this line to your composer.json
"russ666/yii2-countdown": "*"
Usage
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()}', ], ])
Params
id
Container id.
datetime
Datetime string to countdown. Must be added with timezone, to prevent client-server timezone difference issue.
format
Datetime format for widget (http://hilios.github.io/jQuery.countdown/documentation.html#formatter)
events
Widget events (http://hilios.github.io/jQuery.countdown/documentation.html#events)
options
Container html options.
tagName
Container tag name.
Plugin pages
Homepage - http://hilios.github.io/jQuery.countdown