Skip to content

Commit 908e817

Browse files
committed
Updates to release v1.6.8
1 parent d000533 commit 908e817

6 files changed

+229
-201
lines changed

CHANGE.md

+51-46
Original file line numberDiff line numberDiff line change
@@ -3,93 +3,98 @@ Change Log: `yii2-date-range`
33

44
## Version 1.6.8
55

6-
**Date:** 22-Mar-2017
6+
**Date:** 08-Aug-2017
77

8-
- (enh #85, #86): Add Greek Translations.
9-
- (enh #88): Enhance preset dropdown to default today's date when date is empty.
10-
- (enh #90): Add Date Range Behavior for easier application with model range attributes.
11-
- (enh #91): Update moment library to latest release.
12-
- Update daterangepicker library to latest release.
13-
- Add github contribution and issue/PR logging templates.
14-
- (enh #92): Correct example for Date Range Behavior in README.md.
8+
- Chronological arrangement of issues in CHANGE.log.
9+
- (enh #101): Update Turkish Translations.
10+
- (enh #98): Update Danish Translations.
11+
- (enh #97): Update Hebrew Translations.
12+
- (enh #95): Update Chinese Traditional Translations.
1513
- (enh #93): Various styling enhancements and preset plugin defaults for preset dropdown.
14+
- (enh #92): Correct example for Date Range Behavior in README.md.
15+
- Add github contribution and issue/PR logging templates.
16+
- Update daterangepicker library to latest release.
17+
- (enh #91): Update moment library to latest release.
18+
- (enh #90): Add Date Range Behavior for easier application with model range attributes.
19+
- (enh #88): Enhance preset dropdown to default today's date when date is empty.
20+
- (enh #85, #86): Add Greek Translations.
1621

1722
## Version 1.6.7
1823

1924
**Date:** 12-Jul-2016
2025

21-
- (enh #58): Add support for separate start and end attributes and inputs.
22-
- (enh #59): Add Hungarian Translations.
23-
- (enh #61): Add Dutch Translations.
24-
- (enh #62): Add Romanian Translations.
25-
- Add branch alias for dev-master latest release.
26-
- (bug #65): Correct moment `weekdaysStart` to `weekdaysMin`.
27-
- (enh #67): Parse input change correctly when range input value is cleared.
28-
- (enh #68): Update to latest release of bootstrap-daterangepicker plugin and moment library.
29-
- (bug #70): More better attribute and input options parsing.
30-
- (enh #71): Add Thai translations.
31-
- (bug #73): Correct dependency for `DateRangePickerAsset` and `LanguageAsset`.
32-
- (bug #74): Correct asset bundle dependency.
33-
- (bug #75): Correct code for PHP 5.5.
3426
- (bug #76, #77, #78, #79): Correct dependency for `DateRangePickerAsset`.
27+
- (bug #75): Correct code for PHP 5.5.
28+
- (bug #74): Correct asset bundle dependency.
29+
- (bug #73): Correct dependency for `DateRangePickerAsset` and `LanguageAsset`.
30+
- (enh #71): Add Thai translations.
31+
- (bug #70): More better attribute and input options parsing.
32+
- (enh #68): Update to latest release of bootstrap-daterangepicker plugin and moment library.
33+
- (enh #67): Parse input change correctly when range input value is cleared.
34+
- (bug #65): Correct moment `weekdaysStart` to `weekdaysMin`.
35+
- Add branch alias for dev-master latest release.
36+
- (enh #62): Add Romanian Translations.
37+
- (enh #61): Add Dutch Translations.
38+
- (enh #59): Add Hungarian Translations.
39+
- (enh #58): Add support for separate start and end attributes and inputs.
3540

3641
## Version 1.6.6
3742

3843
**Date:** 11-Jan-2016
3944

40-
- (enh #55): Enhancements for PJAX based reinitialization. Complements enhancements in kartik-v/yii2-krajee-base#52 and kartik-v/yii2-krajee-base#53.
4145
- (enh #56): Update to latest version of bootstrap-daterangepicker.
46+
- (enh #55): Enhancements for PJAX based reinitialization. Complements enhancements in kartik-v/yii2-krajee-base#52 and kartik-v/yii2-krajee-base#53.
4247

4348
## Version 1.6.5
4449

4550
**Date:** 22-Oct-2015
4651

47-
- (enh #52): New property `autoUpdateOnInit` to prevent plugin triggering change due to `pluginOptions['autoUpdateInput']` default setting.
4852
- (enh #53): Added correct German translations.
53+
- (enh #52): New property `autoUpdateOnInit` to prevent plugin triggering change due to `pluginOptions['autoUpdateInput']` default setting.
4954

5055
## Version 1.6.4
5156

5257
**Date:** 19-Oct-2015
5358

54-
- (enh #41): Add Simplified Chinese translations.
55-
- (enh #43): Add Slovak translations.
5659
- (enh #51): Update to latest release of bootstrap-datarangepicker plugin.
60+
- (enh #43): Add Slovak translations.
61+
- (enh #41): Add Simplified Chinese translations.
5762

5863
## Version 1.6.3
5964

6065
**Date:** 22-May-2015
6166

62-
- (enh #31): Add Ukranian translations.
63-
- (enh #32): Add Portugese translations.
64-
- (enh #36): Add Polish translations.
65-
- (enh #38): Update to latest release of bootstrap-datarangepicker plugin.
6667
- (enh #40): Update moment library and locales.
68+
- (enh #38): Update to latest release of bootstrap-datarangepicker plugin.
69+
- (enh #36): Add Polish translations.
70+
- (enh #32): Add Portugese translations.
71+
- (enh #31): Add Ukranian translations.
6772

6873
## Version 1.6.2
6974

7075
**Date:** 02-Mar-2015
7176

72-
- (enh #27): Correct initial value initialization for all cases.
77+
- (enh #29): Improve validation to retrieve the right translation messages folder.
7378
- (enh #28): Upgrade to latest release of bootstrap-daterangepicker plugin.
79+
- (enh #27): Correct initial value initialization for all cases.
7480
- Set copyright year to current.
75-
- (enh #29): Improve validation to retrieve the right translation messages folder.
7681

7782
## Version 1.6.1
7883

7984
**Date:** 16-Feb-2015
8085

81-
- (enh #27): Correct initial value initialization for all cases.
82-
- (enh #28): Upgrade to latest release of bootstrap-daterangepicker plugin.
8386
- Set copyright year to current.
87+
- (enh #28): Upgrade to latest release of bootstrap-daterangepicker plugin.
88+
- (enh #27): Correct initial value initialization for all cases.
8489

8590
## Version 1.6.0
8691

8792
**Date:** 12-Jan-2015
8893

89-
- (enh #22): Estonian translation for kvdrp.php
90-
- (enh #23): Russian translations updated.
91-
- Code formatting updates as per Yii2 standards.
9294
- Revamp to use new Krajee base InputWidget and TranslationTrait.
95+
- Code formatting updates as per Yii2 standards.
96+
- (enh #23): Russian translations updated.
97+
- (enh #22): Estonian translation for kvdrp.php
9398

9499
## Version 1.5.0
95100

@@ -105,35 +110,35 @@ Change Log: `yii2-date-range`
105110

106111
**Date:** 25-Nov-2014
107112

108-
- (enh #17): Updated Russian translations
109-
- (bug #18): Plugin data attributes not set because of input rendering sequence.
110113
- (enh #19): Enhance widget to use updated plugin registration from Krajee base
114+
- (bug #18): Plugin data attributes not set because of input rendering sequence.
115+
- (enh #17): Updated Russian translations
111116

112117
## Version 1.3.0
113118

114119
**Date:** 21-Nov-2014
115120

116-
- (enh #7): Added Russian Translations
117-
- (enh #12): Added Spanish Translations
118-
- (enh #13): Update moment.js related range initializations.
119-
- (enh #14): Update moment library to latest release.
120-
- (enh #15): Revamp widget to remove dependency on custom locale JS files enhancement
121121
- (enh #16): Update Lithunian translations and create German translations.
122+
- (enh #15): Revamp widget to remove dependency on custom locale JS files enhancement
123+
- (enh #14): Update moment library to latest release.
124+
- (enh #13): Update moment.js related range initializations.
125+
- (enh #12): Added Spanish Translations
126+
- (enh #7): Added Russian Translations
122127

123128
## Version 1.2.0
124129

125130
**Date:** 20-Nov-2014
126131

127-
- (bug #11): Fix bug in daterangepicker.js for duplicate dates in Dec 2013.
128132
- Upgrade to latest plugin release 1.3.16 dated 12-Nov-2014.
133+
- (bug #11): Fix bug in daterangepicker.js for duplicate dates in Dec 2013.
129134

130135
## Version 1.1.0
131136

132137
**Date:** 10-Nov-2014
133138

134-
- PSR4 alias change
135-
- Set dependency on Krajee base components
136139
- Set release to stable
140+
- Set dependency on Krajee base components
141+
- PSR4 alias change
137142

138143
## Version 1.0.0
139144

DateRangeBehavior.php

+18-11
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
* @package yii2-date-range
66
* @version 1.6.8
77
*/
8+
89
namespace kartik\daterange;
910

1011
use yii\base\Model;
@@ -81,6 +82,18 @@ class DateRangeBehavior extends Behavior
8182
*/
8283
public $separator;
8384

85+
/**
86+
* Parses the given date into a Unix timestamp.
87+
*
88+
* @param string $date a date string
89+
*
90+
* @return integer|false a Unix timestamp. False on failure.
91+
*/
92+
protected static function dateToTime($date)
93+
{
94+
return strtotime($date);
95+
}
96+
8497
/**
8598
* @inheritdoc
8699
*/
@@ -94,7 +107,9 @@ public function init()
94107
}
95108
} else {
96109
if (!isset($this->dateStartAttribute) || !isset($this->dateEndAttribute)) {
97-
throw new InvalidConfigException('The "dateStartAttribute" and "dateEndAttribute" properties must be specified.');
110+
throw new InvalidConfigException(
111+
'The "dateStartAttribute" and "dateEndAttribute" properties must be specified.'
112+
);
98113
}
99114
}
100115
}
@@ -111,6 +126,7 @@ public function events()
111126

112127
/**
113128
* Handles owner 'afterValidate' event.
129+
*
114130
* @param \yii\base\Event $event event instance.
115131
*/
116132
public function afterValidate($event)
@@ -137,6 +153,7 @@ public function afterValidate($event)
137153

138154
/**
139155
* Evaluates the attribute value and assigns it to the given attribute.
156+
*
140157
* @param string $attribute the owner attribute name
141158
* @param string $dateFormat the PHP date format string
142159
* @param string $date a date string
@@ -154,14 +171,4 @@ protected function setOwnerAttribute($attribute, $dateFormat, $date)
154171
}
155172
}
156173
}
157-
158-
/**
159-
* Parses the given date into a Unix timestamp.
160-
* @param string $date a date string
161-
* @return integer|false a Unix timestamp. False on failure.
162-
*/
163-
protected static function dateToTime($date)
164-
{
165-
return strtotime($date);
166-
}
167174
}

0 commit comments

Comments
 (0)