Skip to content

Commit 9160b1b

Browse files
committed
Recompiled source
1 parent 10c0ee5 commit 9160b1b

File tree

2 files changed

+37
-20
lines changed

2 files changed

+37
-20
lines changed

compiled/flipclock.js

Lines changed: 35 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ var FlipClock;
203203
* Version
204204
*/
205205

206-
version: '0.7.1',
206+
version: '0.7.2',
207207

208208
/**
209209
* Sets the default options
@@ -1345,7 +1345,7 @@ var FlipClock;
13451345
return this.time;
13461346
}
13471347

1348-
return new Date(this.getTimeSeconds());
1348+
return new Date((new Date()).getTime() + this.getTimeSeconds() * 1000);
13491349
},
13501350

13511351
/**
@@ -1434,17 +1434,24 @@ var FlipClock;
14341434
* @return object returns a digitized object
14351435
*/
14361436

1437-
getMilitaryTime: function(date) {
1437+
getMilitaryTime: function(date, showSeconds) {
1438+
if(typeof showSeconds === "undefined") {
1439+
showSeconds = true;
1440+
}
1441+
14381442
if(!date) {
14391443
date = this.getDateObject();
14401444
}
14411445

14421446
var obj = this.digitize([
14431447
date.getHours(),
1444-
date.getMinutes(),
1445-
date.getSeconds()
1448+
date.getMinutes()
14461449
]);
14471450

1451+
if(showSeconds === true) {
1452+
date.getSeconds();
1453+
}
1454+
14481455
return obj;
14491456
},
14501457

@@ -1506,20 +1513,30 @@ var FlipClock;
15061513
* @return object Returns a digitized object
15071514
*/
15081515

1509-
getTime: function(date) {
1516+
getTime: function(date, showSeconds) {
1517+
if(typeof showSeconds === "undefined") {
1518+
showSeconds = true;
1519+
}
1520+
15101521
if(!date) {
15111522
date = this.getDateObject();
15121523
}
1524+
1525+
console.log(date);
1526+
15131527

15141528
var hours = date.getHours();
15151529
var merid = hours > 12 ? 'PM' : 'AM';
1516-
var obj = this.digitize([
1530+
var data = [
15171531
hours > 12 ? hours - 12 : (hours === 0 ? 12 : hours),
1518-
date.getMinutes(),
1519-
date.getSeconds()
1520-
]);
1532+
date.getMinutes()
1533+
];
15211534

1522-
return obj;
1535+
if(showSeconds === true) {
1536+
data.push(date.getSeconds());
1537+
}
1538+
1539+
return this.digitize(data);
15231540
},
15241541

15251542
/**
@@ -1551,7 +1568,7 @@ var FlipClock;
15511568
* @return int Retuns a floored integer
15521569
*/
15531570

1554-
getWeeks: function(mod) {
1571+
getWeeks: function() {
15551572
var weeks = this.getTimeSeconds() / 60 / 60 / 24 / 7;
15561573

15571574
if(mod) {
@@ -1886,7 +1903,7 @@ var FlipClock;
18861903
* @param object Pass the time that should be used to display on the clock.
18871904
*/
18881905

1889-
build: function() {
1906+
build: function(time) {
18901907
var t = this;
18911908
var children = this.factory.$el.find('ul');
18921909

@@ -1896,7 +1913,7 @@ var FlipClock;
18961913
this.factory.time = new FlipClock.Time(this.factory, this.factory.original);
18971914
}
18981915

1899-
var time = this.factory.time.getMilitaryTime();
1916+
var time = time ? time : this.factory.time.getMilitaryTime(false, this.showSeconds);
19001917

19011918
if(time.length > children.length) {
19021919
$.each(time, function(i, digit) {
@@ -1920,7 +1937,7 @@ var FlipClock;
19201937
flip: function(time, doNotAddPlayClass) {
19211938
this.autoIncrement();
19221939

1923-
time = time ? time : this.factory.time.getMilitaryTime();
1940+
time = time ? time : this.factory.time.getMilitaryTime(false, this.showSeconds);
19241941

19251942
this.base(time, doNotAddPlayClass);
19261943
}
@@ -2292,7 +2309,7 @@ var FlipClock;
22922309
build: function() {
22932310
var t = this;
22942311

2295-
var time = this.factory.time.getTime();
2312+
var time = this.factory.time.getTime(false, this.showSeconds);
22962313

22972314
this.base(time);
22982315
this.meridiumText = this.getMeridium();
@@ -2303,7 +2320,7 @@ var FlipClock;
23032320
'</li>',
23042321
'</ul>'
23052322
].join(''));
2306-
2323+
23072324
this.meridium.insertAfter(this.lists[this.lists.length-1].$el);
23082325
},
23092326

@@ -2316,7 +2333,7 @@ var FlipClock;
23162333
this.meridiumText = this.getMeridium();
23172334
this.meridium.find('a').html(this.meridiumText);
23182335
}
2319-
this.base(this.factory.time.getTime(), doNotAddPlayClass);
2336+
this.base(this.factory.time.getTime(false, this.showSeconds), doNotAddPlayClass);
23202337
},
23212338

23222339
/**

0 commit comments

Comments
 (0)