Skip to content

Important fixes #397

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

Open
wants to merge 1 commit into
base: js-es6
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
19 changes: 9 additions & 10 deletions dist/flipclock.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/flipclock.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/flipclock.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/flipclock.min.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion public/Faces_DayCounter.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ <h1 class="mb-0"><a class="navbar-brand" href="./index.html">FlipClock.js</a></h

format(instance, value) {
const now = !instance.started ? new Date : value;
const originalValue = instance.originalValue || value;
const originalValue = value || instance.originalValue;
const a = !this.countdown ? now : originalValue;
const b = !this.countdown ? originalValue : now;

Expand Down
2 changes: 1 addition & 1 deletion public/Faces_HourCounter.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ <h1 class="mb-0"><a class="navbar-brand" href="./index.html">FlipClock.js</a></h

format(instance, value) {
const now = !instance.timer.started ? new Date : value;
const originalValue = instance.originalValue || value;
const originalValue = value || instance.originalValue;
const a = !this.countdown ? now : originalValue;
const b = !this.countdown ? originalValue : now;

Expand Down
2 changes: 1 addition & 1 deletion public/Faces_WeekCounter.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ <h1 class="mb-0"><a class="navbar-brand" href="./index.html">FlipClock.js</a></h

format(instance, value) {
const now = !instance.timer.started ? new Date : value;
const originalValue = instance.originalValue || value;
const originalValue = value || instance.originalValue;
const a = !this.countdown ? now : originalValue;
const b = !this.countdown ? originalValue : now;

Expand Down
2 changes: 1 addition & 1 deletion public/Faces_YearCounter.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ <h1 class="mb-0"><a class="navbar-brand" href="./index.html">FlipClock.js</a></h

format(instance, value) {
const now = !instance.timer.started ? new Date : value;
const originalValue = instance.originalValue || value;
const originalValue = value || instance.originalValue;
const a = !this.countdown ? now : originalValue;
const b = !this.countdown ? originalValue : now;

Expand Down
4 changes: 2 additions & 2 deletions src/js/Components/Face.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,13 +108,13 @@ export default class Face extends Component {
this.increment(instance);
}

callback.call(this, fn);
callback.call(instance, fn);

if(this.shouldStop(instance)) {
instance.stop();
}

return this.emit('interval');
return instance.emit('interval');
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/js/Faces/DayCounter.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export default class DayCounter extends HourCounter {

format(instance, value) {
const now = !instance.started ? new Date : value;
const originalValue = instance.originalValue || value;
const originalValue = value || instance.originalValue;
const a = !this.countdown ? now : originalValue;
const b = !this.countdown ? originalValue : now;

Expand Down
4 changes: 2 additions & 2 deletions src/js/Faces/HourCounter.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import MinuteCounter from './MinuteCounter';
export default class HourCounter extends MinuteCounter {

format(instance, value) {
const now = !instance.timer.started ? new Date : value;
const originalValue = instance.originalValue || value;
const now = !instance.timer.started ? new Date : instance.timer.started;
const originalValue = value || instance.originalValue;
const a = !this.countdown ? now : originalValue;
const b = !this.countdown ? originalValue : now;

Expand Down
4 changes: 2 additions & 2 deletions src/js/Faces/MinuteCounter.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Face from '../Components/Face';
import { noop, round, isNull, isUndefined, isNumber, callback } from '../Helpers/Functions';
import {isNull, isNumber, isUndefined, noop, round} from '../Helpers/Functions';

/**
* @classdesc This face is meant to display a clock that shows minutes, and
Expand Down Expand Up @@ -53,7 +53,7 @@ export default class MinuteCounter extends Face {
}

format(instance, value) {
const started = instance.timer.isRunning ? instance.timer.started : new Date(Date.now() - 50);
const started = instance.timer.isRunning ? instance.timer.started : new Date;

return [
[this.getMinutes(value, started)],
Expand Down
2 changes: 1 addition & 1 deletion src/js/Faces/WeekCounter.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export default class WeekCounter extends DayCounter {

format(instance, value) {
const now = !instance.timer.started ? new Date : value;
const originalValue = instance.originalValue || value;
const originalValue = value || instance.originalValue;
const a = !this.countdown ? now : originalValue;
const b = !this.countdown ? originalValue : now;

Expand Down
2 changes: 1 addition & 1 deletion src/js/Faces/YearCounter.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export default class YearCounter extends WeekCounter {

format(instance, value) {
const now = !instance.timer.started ? new Date : value;
const originalValue = instance.originalValue || value;
const originalValue = value || instance.originalValue;
const a = !this.countdown ? now : originalValue;
const b = !this.countdown ? originalValue : now;

Expand Down