fix locale date format in report header and more (#2520)

* fix problem with empty end datetime in edit time
* fixed calendar creation with tags in "pre-defined tags" mode
* fix locale date format in report header
This commit is contained in:
Kevin Papst
2021-04-21 22:23:32 +02:00
committed by GitHub
parent 305a2fd4f6
commit ff7a402bd4
5 changed files with 14 additions and 13 deletions

View File

@@ -32,11 +32,16 @@ final class TimesheetEntry implements DragAndDropEntry
public function getData(): array
{
$tags = null;
if (!empty($this->timesheet->getTagsAsArray())) {
$tags = implode(',', $this->timesheet->getTagsAsArray());
}
return [
'description' => $this->timesheet->getDescription(),
'activity' => $this->timesheet->getActivity() !== null ? $this->timesheet->getActivity()->getId() : null,
'project' => $this->timesheet->getProject() !== null ? $this->timesheet->getProject()->getId() : null,
'tags' => implode(',', $this->timesheet->getTagsAsArray()),
'tags' => $tags,
];
}

View File

@@ -28,19 +28,14 @@ class TimesheetApiEditForm extends TimesheetEditForm
if ($builder->has('user')) {
$builder->get('user')->setRequired(false);
}
}
/**
* Method added to prevent API BC breaks.
*
* @param FormBuilderInterface $builder
*/
protected function addTags(FormBuilderInterface $builder)
{
$builder
->add('tags', TagsInputType::class, [
if ($builder->has('tags')) {
$builder->remove('tags');
// @deprecated for BC reasons here, arrays will be supported in 2.0
$builder->add('tags', TagsInputType::class, [
'required' => false,
]);
}
}
public function configureOptions(OptionsResolver $resolver)

View File

@@ -39,7 +39,7 @@
{% for day in days %}
<th class="text-center text-nowrap{% if day.day is weekend %} weekend{% endif %}">
{{ day.day|day_name(true) }}<br>
{{ day.day|date_format('d.m') }}
{{ day.day|format_date('short') }}
</th>
{% endfor %}
</tr>

View File

@@ -24,7 +24,7 @@
{% for day in days %}
<th class="text-center text-nowrap{% if day is weekend %} weekend{% endif %}">
{{ day|day_name(true) }}<br>
{{ day|date_format('d.m') }}
{{ day|format_date('short') }}
</th>
{% endfor %}
</tr>

View File

@@ -248,6 +248,7 @@
{
if (durationMoment === null) {
getDurationField().value = '';
return;
}
if (!durationMoment.isValid()) {