@@ -118,13 +118,13 @@ class IntlDateFormatter
118
118
private $ timeZoneId ;
119
119
120
120
/**
121
- * @param string $locale The locale code. The only currently supported locale is "en" (or null using the default locale, i.e. "en")
122
- * @param int $datetype Type of date formatting, one of the format type constants
123
- * @param int $timetype Type of time formatting, one of the format type constants
124
- * @param mixed $timezone Timezone identifier
125
- * @param int $calendar Calendar to use for formatting or parsing. The only currently
126
- * supported value is IntlDateFormatter::GREGORIAN (or null using the default calendar, i.e. "GREGORIAN")
127
- * @param string $pattern Optional pattern to use when formatting
121
+ * @param string $locale The locale code. The only currently supported locale is "en" (or null using the default locale, i.e. "en")
122
+ * @param int|null $datetype Type of date formatting, one of the format type constants
123
+ * @param int|null $timetype Type of time formatting, one of the format type constants
124
+ * @param mixed $timezone Timezone identifier
125
+ * @param int $calendar Calendar to use for formatting or parsing. The only currently
126
+ * supported value is IntlDateFormatter::GREGORIAN (or null using the default calendar, i.e. "GREGORIAN")
127
+ * @param string $pattern Optional pattern to use when formatting
128
128
*
129
129
* @see http://www.php.net/manual/en/intldateformatter.create.php
130
130
* @see http://userguide.icu-project.org/formatparse/datetime
@@ -144,6 +144,8 @@ public function __construct($locale, $datetype, $timetype, $timezone = null, $ca
144
144
145
145
$ this ->datetype = $ datetype ;
146
146
$ this ->timetype = $ timetype ;
147
+ $ this ->datetype = null !== $ datetype ? $ datetype : self ::FULL ;
148
+ $ this ->timetype = null !== $ timetype ? $ timetype : self ::FULL ;
147
149
148
150
$ this ->setPattern ($ pattern );
149
151
$ this ->setTimeZone ($ timezone );
0 commit comments