aboutsummaryrefslogtreecommitdiffhomepage
path: root/public/bower_components/bootstrap-datepicker/tests/assets/utils.js
diff options
context:
space:
mode:
Diffstat (limited to 'public/bower_components/bootstrap-datepicker/tests/assets/utils.js')
-rw-r--r--public/bower_components/bootstrap-datepicker/tests/assets/utils.js21
1 files changed, 21 insertions, 0 deletions
diff --git a/public/bower_components/bootstrap-datepicker/tests/assets/utils.js b/public/bower_components/bootstrap-datepicker/tests/assets/utils.js
new file mode 100644
index 0000000..6f9cac5
--- /dev/null
+++ b/public/bower_components/bootstrap-datepicker/tests/assets/utils.js
@@ -0,0 +1,21 @@
+function UTCDate(){
+ return new Date(Date.UTC.apply(Date, arguments));
+}
+
+
+function format_date(date){
+ var y = date.getUTCFullYear(),
+ m = date.getUTCMonth() + 1,
+ d = date.getUTCDate(),
+ h = date.getUTCHours(),
+ i = date.getUTCMinutes(),
+ s = date.getUTCSeconds(),
+ l = date.getUTCMilliseconds();
+ function z(i){return (i <= 9 ? '0'+i : i);}
+ return y+'-'+z(m)+'-'+z(d)+' '+z(h)+':'+z(i)+':'+z(s)+'.'+z(l);
+}
+
+
+function datesEqual(actual, expected, message){
+ QUnit.push(QUnit.equiv(actual, expected), format_date(actual), format_date(expected), message);
+}