Skip to content
This repository has been archived by the owner on Aug 20, 2022. It is now read-only.

Commit

Permalink
Release v0.5.3
Browse files Browse the repository at this point in the history
  • Loading branch information
fengyuanchen committed May 30, 2017
1 parent 0613784 commit b93426f
Show file tree
Hide file tree
Showing 14 changed files with 135 additions and 52 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
# Changelog


## 0.5.3 (May 30, 2017)

- Highlight the current year and month.
- Highlight the picked year and month.


## 0.5.2 (Apr 8, 2017)

- Fixed year and month picking issue.
Expand Down
4 changes: 2 additions & 2 deletions dist/datepicker.css
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/*!
* Datepicker v0.5.2
* Datepicker v0.5.3
* https://github.com/fengyuanchen/datepicker
*
* Copyright (c) 2014-2017 Fengyuan Chen
* Released under the MIT license
*
* Date: 2017-04-08T12:04:53.399Z
* Date: 2017-05-30T03:33:52.900Z
*/
.datepicker-container {
font-size: 12px;
Expand Down
50 changes: 37 additions & 13 deletions dist/datepicker.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/*!
* Datepicker v0.5.2
* Datepicker v0.5.3
* https://github.com/fengyuanchen/datepicker
*
* Copyright (c) 2014-2017 Fengyuan Chen
* Released under the MIT license
*
* Date: 2017-04-08T12:04:43.796Z
* Date: 2017-05-30T03:33:51.775Z
*/

(function (factory) {
Expand Down Expand Up @@ -534,6 +534,8 @@
var viewYear = viewDate.getFullYear();
var viewMonth = viewDate.getMonth();
var viewDay = viewDate.getDate();
var now = new Date();
var thisYear = now.getFullYear();
var date = this.date;
var year = date.getFullYear();
var isPrevDisabled = false;
Expand Down Expand Up @@ -577,7 +579,8 @@
view: isDisabled ? 'year disabled' : isPicked ? 'year picked' : 'year',
muted: isMuted,
picked: isPicked,
disabled: isDisabled
disabled: isDisabled,
highlighted: date.getFullYear() === thisYear
});
}

Expand All @@ -599,6 +602,9 @@
var viewDate = this.viewDate;
var viewYear = viewDate.getFullYear();
var viewDay = viewDate.getDate();
var now = new Date();
var thisYear = now.getFullYear();
var thisMonth = now.getMonth();
var date = this.date;
var year = date.getFullYear();
var month = date.getMonth();
Expand Down Expand Up @@ -633,7 +639,8 @@
text: months[i],
view: isDisabled ? 'month disabled' : isPicked ? 'month picked' : 'month',
picked: isPicked,
disabled: isDisabled
disabled: isDisabled,
highlighted: viewYear === thisYear && date.getMonth() === thisMonth
});
}

Expand Down Expand Up @@ -712,6 +719,7 @@

for (i = length - (n - 1); i <= length; i++) {
date = new Date(prevViewYear, prevViewMonth, i);
isPicked = prevViewYear === year && prevViewMonth === month && i === day;
isDisabled = false;

if (startDate) {
Expand All @@ -726,6 +734,7 @@
text: i,
view: 'day prev',
muted: true,
picked: isPicked,
disabled: isDisabled,
highlighted: prevViewYear === thisYear && prevViewMonth === thisMonth && date.getDate() === today
}));
Expand Down Expand Up @@ -756,6 +765,7 @@

for (i = 1; i <= n; i++) {
date = new Date(nextViewYear, nextViewMonth, i);
isPicked = nextViewYear === year && nextViewMonth === month && i === day;
isDisabled = false;

if (endDate) {
Expand All @@ -770,6 +780,7 @@
text: i,
view: 'day next',
muted: true,
picked: isPicked,
disabled: isDisabled,
highlighted: nextViewYear === thisYear && nextViewMonth === thisMonth && date.getDate() === today
}));
Expand Down Expand Up @@ -821,6 +832,7 @@

click: function (e) {
var $target = $(e.target);
var options = this.options;
var viewDate = this.viewDate;
var viewYear;
var viewMonth;
Expand Down Expand Up @@ -871,18 +883,19 @@
break;

case 'year current':

if (this.format.hasYear) {
this.showView(2);
}

break;

case 'year picked':

if (this.format.hasMonth) {
this.showView(1);
} else {
$target.addClass(options.pickedClass)
.siblings()
.removeClass(options.pickedClass);
this.hideView();
}

Expand All @@ -892,11 +905,14 @@
case 'year':
viewYear = parseInt($target.text(), 10);
this.date = new Date(viewYear, viewMonth, min(viewDay, 28));
this.viewDate = new Date(viewYear, viewMonth, min(viewDay, 28));

if (this.format.hasMonth) {
this.viewDate = new Date(viewYear, viewMonth, min(viewDay, 28));
this.showView(1);
} else {
$target.addClass(options.pickedClass)
.siblings()
.removeClass(options.pickedClass);
this.hideView();
}

Expand All @@ -911,32 +927,36 @@
break;

case 'month current':

if (this.format.hasMonth) {
this.showView(1);
}

break;

case 'month picked':

if (this.format.hasDay) {
this.showView(0);
} else {
$target.addClass(options.pickedClass)
.siblings()
.removeClass(options.pickedClass);
this.hideView();
}

this.pick('month');
break;

case 'month':
viewMonth = $.inArray($target.text(), this.options.monthsShort);
viewMonth = $.inArray($target.text(), options.monthsShort);
this.date = new Date(viewYear, viewMonth, min(viewDay, 28));
this.viewDate = new Date(viewYear, viewMonth, min(viewDay, 28));

if (this.format.hasDay) {
this.viewDate = new Date(viewYear, viewMonth, min(viewDay, 28));
this.showView(0);
} else {
$target.addClass(options.pickedClass)
.siblings()
.removeClass(options.pickedClass);
this.hideView();
}

Expand All @@ -949,8 +969,9 @@
viewMonth = view === 'day prev' ? viewMonth - 1 : view === 'day next' ? viewMonth + 1 : viewMonth;
viewDay = parseInt($target.text(), 10);
this.date = new Date(viewYear, viewMonth, viewDay);
this.viewDate = new Date(viewYear, viewMonth, viewDay);
this.fillDays();
$target.addClass(options.pickedClass)
.siblings()
.removeClass(options.pickedClass);

if (view === 'day') {
this.hideView();
Expand All @@ -960,6 +981,9 @@
break;

case 'day picked':
$target.addClass(options.pickedClass)
.siblings()
.removeClass(options.pickedClass);
this.hideView();
this.pick('day');
break;
Expand Down
4 changes: 2 additions & 2 deletions dist/datepicker.min.css

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

6 changes: 3 additions & 3 deletions dist/datepicker.min.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/css/datepicker.css
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/*!
* Datepicker v0.5.2
* Datepicker v0.5.3
* https://github.com/fengyuanchen/datepicker
*
* Copyright (c) 2014-2017 Fengyuan Chen
* Released under the MIT license
*
* Date: 2017-04-08T12:04:53.399Z
* Date: 2017-05-30T03:33:52.900Z
*/
.datepicker-container {
font-size: 12px;
Expand Down
4 changes: 2 additions & 2 deletions docs/css/datepicker.min.css

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

8 changes: 6 additions & 2 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
<!-- Jumbotron -->
<div class="jumbotron docs-jumbotron">
<div class="container">
<h1>Datepicker <small class="version">v0.5.2</small></h1>
<h1>Datepicker <small class="version">v0.5.3</small></h1>
<p class="lead">A simple jQuery datepicker plugin.</p>
<div class="docs-carbonads-container">
<div class="docs-carbonads">
Expand Down Expand Up @@ -99,6 +99,7 @@ <h3 class="page-header">Options</h3>
<div class="input-group">
<span class="input-group-addon" id="option-language">language</span>
<select class="form-control" id="option-language" name="language">
<option value="ca-ES">ca-ES</option>
<option value="cs-CZ">cs-CZ</option>
<option value="de-DE">de-DE</option>
<option value="en-GB">en-GB</option>
Expand All @@ -108,7 +109,9 @@ <h3 class="page-header">Options</h3>
<option value="fr-FR">fr-FR</option>
<option value="ja-JP">ja-JP</option>
<option value="nl-NL">nl-NL</option>
<option value="pl-PL">pl-PL</option>
<option value="pt-BR">pt-BR</option>
<option value="sk-SK">sk-SK</option>
<option value="sv-SE">sv-SE</option>
<option value="tr-TR">tr-TR</option>
<option value="zh-CN">zh-CN</option>
Expand Down Expand Up @@ -277,13 +280,14 @@ <h3 class="page-header">Methods</h3>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<script src="https://fengyuanchen.github.io/js/common.js"></script>
<script src="js/datepicker.js"></script>
<script src="js/datepicker.ca-ES.js"></script>
<script src="js/datepicker.cs-CZ.js"></script>
<script src="js/datepicker.de-DE.js"></script>
<script src="js/datepicker.en-GB.js"></script>
<script src="js/datepicker.en-US.js"></script>
<script src="js/datepicker.es-ES.js"></script>
<script src="js/datepicker.fr-FR.js"></script>
<script src="js/datepicker.fi-FI.js"></script>
<script src="js/datepicker.fr-FR.js"></script>
<script src="js/datepicker.ja-JP.js"></script>
<script src="js/datepicker.nl-NL.js"></script>
<script src="js/datepicker.pl-PL.js"></script>
Expand Down
25 changes: 25 additions & 0 deletions docs/js/datepicker.ca-ES.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
(function (factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as anonymous module.
define('datepicker.ca-ES', ['jquery'], factory);
} else if (typeof exports === 'object') {
// Node / CommonJS
factory(require('jquery'));
} else {
// Browser globals.
factory(jQuery);
}
})(function ($) {

'use strict';

$.fn.datepicker.languages['ca-ES'] = {
format: 'dd/mm/yyyy',
days: ['diumenge', 'dilluns', 'dimarts', 'dimecres', 'dijous', 'divendres', 'dissabte'],
daysShort: ['dg.', 'dl.', 'dt.', 'dc.', 'dj.', 'dv.', 'ds.'],
daysMin: ['dg', 'dl', 'dt', 'dc', 'dj', 'dv', 'ds'],
weekStart: 1,
months: ['gener', 'febrer', 'març', 'abril', 'maig', 'juny', 'juliol', 'agost', 'setembre', 'octubre', 'novembre', 'desembre'],
monthsShort: ['gen.', 'febr.', 'març', 'abr.', 'maig', 'juny', 'jul.', 'ag.', 'set.', 'oct.', 'nov.', 'des.']
};
});
2 changes: 1 addition & 1 deletion docs/js/datepicker.es-ES.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
days: ['Domingo','Lunes','Martes','Miércoles','Jueves','Viernes','Sábado'],
daysShort: ['Dom','Lun','Mar','Mie','Jue','Vie','Sab'],
daysMin: ['Do','Lu','Ma','Mi','Ju','Vi','Sa'],
weekStart: 0,
weekStart: 1,
months: ['Enero','Febrero','Marzo','Abril','Mayo','Junio','Julio','Agosto','Septiembre','Octubre','Noviembre','Diciembre'],
monthsShort: ['Ene','Feb','Mar','Abr','May','Jun','Jul','Ago','Sep','Oct','Nov','Dic']
};
Expand Down
16 changes: 8 additions & 8 deletions docs/js/datepicker.fr-FR.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@
'use strict';

$.fn.datepicker.languages['fr-FR'] = {
format: 'dd/mm/yyyy',
days: ['Dimanche', 'Lundi', 'Mardi', 'Mercredi', 'Jeudi', 'Vendredi', 'Samedi'],
daysShort: ['Dim', 'Lun', 'Mar', 'Mer', 'Jeu', 'Ven', 'Sam'],
daysMin: ['Di', 'Lu', 'Ma', 'Me', 'Je', 'Ve', 'Sa'],
weekStart: 1,
months: ['Janvier', 'Février', 'Mars', 'Avril', 'Mai', 'Juin', 'Juillet', 'Aout', 'Septembre', 'Octobre', 'Novembre', 'Décembre'],
monthsShort: ['Jan', 'Fev', 'Mar', 'Avr', 'Mai', 'Jun', 'Jui', 'Aou', 'Sep', 'Oct', 'Nov', 'Dec']
};
format: 'dd/mm/yyyy',
days: ['Dimanche', 'Lundi', 'Mardi', 'Mercredi', 'Jeudi', 'Vendredi', 'Samedi'],
daysShort: ['Dim', 'Lun', 'Mar', 'Mer', 'Jeu', 'Ven', 'Sam'],
daysMin: ['Di', 'Lu', 'Ma', 'Me', 'Je', 'Ve', 'Sa'],
weekStart: 1,
months: ['Janvier', 'Février', 'Mars', 'Avril', 'Mai', 'Juin', 'Juillet', 'Aout', 'Septembre', 'Octobre', 'Novembre', 'Décembre'],
monthsShort: ['Jan', 'Fev', 'Mar', 'Avr', 'Mai', 'Jun', 'Jui', 'Aou', 'Sep', 'Oct', 'Nov', 'Dec']
};
});
Loading

0 comments on commit b93426f

Please sign in to comment.