Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restart function is implemented. The user can go back at the same tim… #284

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "jquery.countdown",
"version": "2.2.0",
"version": "2.2.1",
"description": "jQuery plugin to display a countdown clock on your page",
"keywords": [
"countdown",
Expand Down
2 changes: 1 addition & 1 deletion countdown.jquery.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "countdown",
"version": "2.2.0",
"version": "2.2.1",
"title": "The Final Countdown",
"description": "jQuery plugin to display a countdown clock on your page.",
"keywords": [
Expand Down
9 changes: 7 additions & 2 deletions dist/jquery.countdown.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*!
* The Final Countdown for jQuery v2.2.0 (http://hilios.github.io/jQuery.countdown/)
* Copyright (c) 2016 Edson Hilios
* The Final Countdown for jQuery v2.2.1 (http://hilios.github.io/jQuery.countdown/)
* Copyright (c) 2017 Edson Hilios
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
Expand Down Expand Up @@ -166,6 +166,11 @@
},
pause: function() {
this.stop();
this.diferenceDate = this.finalDate.getTime() - new Date().getTime();
},
restart: function() {
this.finalDate = new Date(new Date().getTime() + this.diferenceDate);
this.resume();
},
resume: function() {
this.start();
Expand Down
6 changes: 3 additions & 3 deletions dist/jquery.countdown.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "jquery-countdown",
"version": "2.2.0",
"version": "2.2.1",
"main": "dist/jquery.countdown.js",
"description": "The Final Countdown for jQuery",
"author": "Edson Hilios",
Expand Down
7 changes: 6 additions & 1 deletion src/countdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,12 @@
}
},
pause: function() {
this.stop();
this.stop();
this.diferenceDate = this.finalDate.getTime() - new Date().getTime();
},
restart: function() {
this.finalDate = new Date(new Date().getTime() + this.diferenceDate);
this.resume();
},
resume: function() {
this.start();
Expand Down