russ666 / yii2-countdown Goto Github PK
View Code? Open in Web Editor NEWjQuery countdown widget for Yii2
License: MIT License
jQuery countdown widget for Yii2
License: MIT License
Hi!
How to override or add html tag.
For example.
default:
<!span id="w0">01 02 23 12 84 20 34 10<!/span>
i needed:
<!div id="countdown_dashboard">
<!div class="dash weeks_dash">
<!span class="dash_title">weeks<!/span>
<!divclass="digit">0<!/div>
<!div class="digit">1<!/div>
<!/div>
<!/div>
Thanks.
@russ, I have just inserted the widget in my view file, it is displaying 00:00:00. But it is not counting down.
Please, how can i make it to start counting down ?
The code i used is:
<?php
echo \russ666\widgets\Countdown::widget([
'datetime' => date('Y-m-d H:i:s', time() + 2500),
'format' => '%H:%M:%S',
'events' => [
'finish' => 'function(){location.reload()}',
],
])
?>
Can you release a version to make the composer install it?
I suggest you to use moment.js with countdown, because server can be in one timezone, but client in another. In which case countdown does not work, because client time is larger than server time.
You can use moment js by this way:
$script = " var countdownTo = moment.tz('{$this->datetime}','Europe/Minsk'); "; $script.= 'jQuery("#' . $this->id . '").countdown(countdownTo.toDate(), function(e) {$(this).html(e.strftime("' . $this->format . '"))})';
Hello,
When i integrate it than it throws me : A non well formed numeric value encountered
echo \russ666\widgets\Countdown::widget([
'datetime' => date('Y-m-d H:i:s O', $nextMatchData->start_date.' '.$nextMatchData->start_time),
'format' => '%M:%S',
'events' => [
'finish' => 'function(){location.reload()}',
],
])
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.