Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixes, glDatePicker tests

  • Loading branch information...
commit 99af9aba7548cf50cf9d75aa088a11b9aa4e4a40 1 parent edb48ff
@qcz qcz authored
Showing with 90 additions and 1 deletion.
  1. +89 −0 gldatepicker/gldatepicker-tests.ts
  2. +1 −1  mousetrap/mousetrap.d.ts
View
89 gldatepicker/gldatepicker-tests.ts
@@ -0,0 +1,89 @@
+/// <reference path="../jquery/jquery.d.ts"/>
+/// <reference path="gldatepicker.d.ts"/>
+
+$('input').glDatePicker();
+$('#example2').glDatePicker(
+{
+ showAlways: true,
+ allowMonthSelect: false,
+ allowYearSelect: false,
+ prevArrow: '',
+ nextArrow: '',
+ selectedDate: new Date(2013, 8, 5),
+ selectableDateRange: [
+ {
+ from: new Date(2013, 8, 1),
+ to: new Date(2013, 8, 10)
+ },
+ {
+ from: new Date(2013, 8, 19),
+ to: new Date(2013, 8, 22)
+ },
+ ],
+ selectableDates: [
+ { date: new Date(2013, 8, 24) },
+ { date: new Date(2013, 8, 30) }
+ ]
+});
+
+$('#example3').glDatePicker(
+{
+ showAlways: true,
+ cssName: 'darkneon',
+ selectedDate: new Date(2013, 0, 5),
+ specialDates: [
+ {
+ date: new Date(2013, 0, 8),
+ data: { message: 'Meeting every day 8 of the month' },
+ repeatMonth: true
+ },
+ {
+ date: new Date(0, 0, 1),
+ data: { message: 'Happy New Year!' },
+ repeatYear: true
+ },
+ ],
+ onClick: function (target, cell, date, data) {
+ target.val(date.getFullYear() + ' - ' +
+ date.getMonth() + ' - ' +
+ date.getDate());
+
+ if (data != null) {
+ alert(data.message + '\n' + date);
+ }
+ }
+});
+
+$('#example4').glDatePicker(
+{
+ showAlways: true,
+ selectedDate: new Date(2013, 8, 5),
+ dowOffset: 3,
+ selectableYears: [2012, 2013, 2014],
+ selectableMonths: [8, 11],
+ selectableDOW: [1, 4, 6]
+});
+
+// Doing it in a single pass
+var myDatePicker = $('#example1').glDatePicker(
+{
+ showAlways: true,
+ selectableDOW: [0, 2, 3]
+}).glDatePicker(true);
+
+// Or you can do it with multiple calls
+$('example1').glDatePicker(
+{
+ showAlways: true,
+ selectableDOW: [0, 2, 3]
+});
+
+// This example updates some options (calling render will re-generate the calendar)
+$.extend(myDatePicker.options,
+{
+ cssName: 'darkneon',
+ allowMonthSelect: false,
+ allowYearSelect: false
+});
+myDatePicker.render();
+myDatePicker.show();
View
2  mousetrap/mousetrap.d.ts
@@ -1,6 +1,6 @@
// Type definitions for Mousetrap 1.2.2
// Project: http://craig.is/killing/mice
-// Definitions by: Dániel Tar https://github.com/qcz
+// Definitions by: Dániel Tar https://github.com/qcz
// Definitions: https://github.com/borisyankov/DefinitelyTyped
interface ExtendedKeyboardEvent extends KeyboardEvent {
Please sign in to comment.
Something went wrong with that request. Please try again.