Giter Site home page Giter Site logo

yii2-countdown's People

Contributors

russ666 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

yii2-countdown's Issues

How to add my html tag?

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.

NOT counting down

@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()}',
],
])

                  ?>

Using with moment js.

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 . '"))})';

A non well formed numeric value encountered

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()}',
                                      ],
                              ])

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.