Skip to content

Commit c48328f

Browse files
committed
Added support for no default date [nazar-pc#70](nazar-pc#70), thanks to Amar Syla for pull request!
New release 2.8.0
1 parent 25e9df8 commit c48328f

File tree

6 files changed

+35
-28
lines changed

6 files changed

+35
-28
lines changed

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name" : "pickmeup",
3-
"version" : "2.7.0",
3+
"version" : "2.8.0",
44
"homepage" : "https://github.com/nazar-pc/PickMeUp",
55
"authors" : [
66
"Nazar Mokrynskyi <[email protected]>"

changelog.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
2.8.0 (08 April, 2015)
2+
* Added support for no default date [#70](https://github.com/nazar-pc/PickMeUp/pull/70), thanks to Amar Syla for pull request!
3+
14
2.7.0 (31 March, 2015)
25
* Added UMD support [#63](https://github.com/nazar-pc/PickMeUp/pull/63), thanks to Przemysław Piątek for pull request!
36

js/jquery.pickmeup.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -903,15 +903,19 @@
903903
}
904904
}
905905
} else {
906-
if($this.val() != '' || options.default_date !== false) {
906+
if($this.val() || options.default_date !== false) {
907907
options.date = options.date.constructor == Array ? options.date[0].valueOf() : options.date.valueOf();
908908
}
909909
}
910910
options.current = new Date (options.mode != 'single' ? options.date[0] : options.date);
911911
options.binded.fill();
912912
if ($this.is('input')) {
913913
var prepared_date = prepareDate(options);
914-
$this.val(options.mode == 'single' ? ((options.default_date === false) ? (($this.val() != '') ? $this.val() : '') : prepared_date[0]) : prepared_date[0].join(options.separator));
914+
$this.val(
915+
options.mode == 'single'
916+
? (options.default_date === false ? $this.val() : prepared_date[0])
917+
: prepared_date[0].join(options.separator)
918+
);
915919
}
916920
}
917921
function destroy () {

js/jquery.pickmeup.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"date",
88
"calendar"
99
],
10-
"version" : "2.7.0",
10+
"version" : "2.8.0",
1111
"homepage" : "https://github.com/nazar-pc/PickMeUp",
1212
"author" : {
1313
"name" : "Nazar Mokrynskyi",

readme.md

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -58,29 +58,29 @@ All options and events are the same.
5858

5959

6060
## Configuration options
61-
| Option | Value | Default | Description |
62-
|-----------------|-------------------------------|------------------|------------------------------------------------------------------------------------------------------------- |
63-
| date | array/object/string | new Date | Selected date after initialization. Can be single date string/object or array depending on selection mode |
64-
| default_date | array/object/string/boolean | new Date | Allows to keep empty value until date selected, but open PickMeUp at this default date (false for no default date) |
65-
| flat | boolean | false | Whatever if the date picker is appended to the element or triggered by an event |
66-
| first_day | 0/1 | 1 | First day of week: 0 - Sunday, 1 - Monday |
67-
| prev | string | &#9664; | Previous button content |
68-
| next | string | &#9654; | Next button content |
69-
| mode | single/multiple/range | single | Date selection mode |
70-
| select_day | boolean | true | Allow or deny days selection |
71-
| select_month | boolean | true | Allow or deny months selection |
72-
| select_year | boolean | true | Allow or deny year selection |
73-
| view | days/months/years | days | View mode after initialization |
74-
| calendars | int | 1 | Number of calendars, that will be rendered |
75-
| format | string | d-m-Y | Date format (aAbBCdeHIjklmMpPsSuwyY are supported) |
76-
| position | top/right/bottom/left | bottom | Date picker's position relative to the triggered element |
77-
| trigger_event | string | click touchstart | Event to trigger the date picker |
78-
| class_name | string | | Class to be added to root datepicker element |
79-
| hide_on_select | boolean | false | If `true` - datepicker will be hidden after selection (for range mode allows to select first and last days) |
80-
| min | null/object/string | null | Min date available for selection, `null` means no limitation |
81-
| max | null/object/string | null | Max date available for selection, `null` means no limitation |
82-
| separator | string | ` - ` | Is used for joining separate dates in multiple mode and first/last dates in range mode |
83-
| locale | object | | Object, that contains localized days of week names and months
61+
| Option | Value | Default | Description |
62+
|-----------------|---------------------------|------------------|----------------------------------------------------------------------------------------------------------------------|
63+
| date | array/object/string | new Date | Selected date after initialization. Can be single date string/object or array depending on selection mode |
64+
| default_date | array/false/object/string | new Date | Allows to keep empty value until date selected, but open PickMeUp at this default date (`false` for no default date) |
65+
| flat | boolean | false | Whatever if the date picker is appended to the element or triggered by an event |
66+
| first_day | 0/1 | 1 | First day of week: 0 - Sunday, 1 - Monday |
67+
| prev | string | &#9664; | Previous button content |
68+
| next | string | &#9654; | Next button content |
69+
| mode | single/multiple/range | single | Date selection mode |
70+
| select_day | boolean | true | Allow or deny days selection |
71+
| select_month | boolean | true | Allow or deny months selection |
72+
| select_year | boolean | true | Allow or deny year selection |
73+
| view | days/months/years | days | View mode after initialization |
74+
| calendars | int | 1 | Number of calendars, that will be rendered |
75+
| format | string | d-m-Y | Date format (aAbBCdeHIjklmMpPsSuwyY are supported) |
76+
| position | top/right/bottom/left | bottom | Date picker's position relative to the triggered element |
77+
| trigger_event | string | click touchstart | Event to trigger the date picker |
78+
| class_name | string | | Class to be added to root datepicker element |
79+
| hide_on_select | boolean | false | If `true` - datepicker will be hidden after selection (for range mode allows to select first and last days) |
80+
| min | null/object/string | null | Min date available for selection, `null` means no limitation |
81+
| max | null/object/string | null | Max date available for selection, `null` means no limitation |
82+
| separator | string | ` - ` | Is used for joining separate dates in multiple mode and first/last dates in range mode |
83+
| locale | object | | Object, that contains localized days of week names and months
8484
## Events callbacks
8585
`this` in any callback will be the same element, on which pickmeup() was called.
8686
Events are specified as regular options:

0 commit comments

Comments
 (0)