File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change 1616 */
1717class Date extends \DateTime {
1818
19+ /**
20+ * Support for Null values
21+ * @var bool
22+ */
23+ public bool $ isNull = false ;
24+
1925 /**
2026 * AbraFlexi date to PHP DateTime conversion
2127 *
@@ -24,6 +30,7 @@ class Date extends \DateTime {
2430 * @return \DateTime | false
2531 */
2632 public function __construct (string $ flexidate = 'NOW ' ) {
33+ $ this ->isNull = is_null ($ flexidate );
2734 $ format = '' ;
2835 if (strstr ($ flexidate , '+ ' )) {
2936 $ format = RO ::$ DateFormat . 'O ' ;
@@ -41,7 +48,7 @@ public function __construct(string $flexidate = 'NOW') {
4148 * @return string
4249 */
4350 public function __toString () {
44- return $ this ->format (RO ::$ DateFormat );
51+ return $ this ->isNull ? null : $ this -> format (RO ::$ DateFormat );
4552 }
4653
4754}
You can’t perform that action at this time.
0 commit comments