Skip to content
This repository was archived by the owner on Dec 19, 2025. It is now read-only.

Commit 7e29f15

Browse files
authored
Merge pull request #92 from xiaohutai/feature/fix-issue-91
Set correct label for Date fields in Repeaters/Blocks
2 parents 1adcfad + 27328b6 commit 7e29f15

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

src/Parser/Field/FieldFactory.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ public static function build(
8787
null,
8888
$repeatingFieldCollection
8989
);
90+
9091
//We want to append repeating fields to a repeating collection if it is the same type
9192
if ($repeatingCollection) {
9293
//Check to see if the repeating field is a different repeater to create a new instance of it and not overwrite the other repeater
@@ -102,7 +103,11 @@ public static function build(
102103
}
103104
}
104105
} elseif ($data instanceof Carbon) {
105-
$type = new Date($field, $data, $config);
106+
if (is_int($label)) {
107+
$type = new Date($field, $data, $config);
108+
} else {
109+
$type = new Date($label, $data, $config);
110+
}
106111
} elseif (!$data instanceof LazyCollection) {
107112
if (($fieldType !== null) && in_array($fieldType, self::$fileTypes)) {
108113
if (is_int($label)) {

0 commit comments

Comments
 (0)