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:
@@ -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,
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -248,6 +248,7 @@
|
||||
{
|
||||
if (durationMoment === null) {
|
||||
getDurationField().value = '';
|
||||
return;
|
||||
}
|
||||
|
||||
if (!durationMoment.isValid()) {
|
||||
|
||||
Reference in New Issue
Block a user