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
|
public function getData(): array
|
||||||
{
|
{
|
||||||
|
$tags = null;
|
||||||
|
if (!empty($this->timesheet->getTagsAsArray())) {
|
||||||
|
$tags = implode(',', $this->timesheet->getTagsAsArray());
|
||||||
|
}
|
||||||
|
|
||||||
return [
|
return [
|
||||||
'description' => $this->timesheet->getDescription(),
|
'description' => $this->timesheet->getDescription(),
|
||||||
'activity' => $this->timesheet->getActivity() !== null ? $this->timesheet->getActivity()->getId() : null,
|
'activity' => $this->timesheet->getActivity() !== null ? $this->timesheet->getActivity()->getId() : null,
|
||||||
'project' => $this->timesheet->getProject() !== null ? $this->timesheet->getProject()->getId() : null,
|
'project' => $this->timesheet->getProject() !== null ? $this->timesheet->getProject()->getId() : null,
|
||||||
'tags' => implode(',', $this->timesheet->getTagsAsArray()),
|
'tags' => $tags,
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -28,20 +28,15 @@ class TimesheetApiEditForm extends TimesheetEditForm
|
|||||||
if ($builder->has('user')) {
|
if ($builder->has('user')) {
|
||||||
$builder->get('user')->setRequired(false);
|
$builder->get('user')->setRequired(false);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
if ($builder->has('tags')) {
|
||||||
* Method added to prevent API BC breaks.
|
$builder->remove('tags');
|
||||||
*
|
// @deprecated for BC reasons here, arrays will be supported in 2.0
|
||||||
* @param FormBuilderInterface $builder
|
$builder->add('tags', TagsInputType::class, [
|
||||||
*/
|
|
||||||
protected function addTags(FormBuilderInterface $builder)
|
|
||||||
{
|
|
||||||
$builder
|
|
||||||
->add('tags', TagsInputType::class, [
|
|
||||||
'required' => false,
|
'required' => false,
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public function configureOptions(OptionsResolver $resolver)
|
public function configureOptions(OptionsResolver $resolver)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -39,7 +39,7 @@
|
|||||||
{% for day in days %}
|
{% for day in days %}
|
||||||
<th class="text-center text-nowrap{% if day.day is weekend %} weekend{% endif %}">
|
<th class="text-center text-nowrap{% if day.day is weekend %} weekend{% endif %}">
|
||||||
{{ day.day|day_name(true) }}<br>
|
{{ day.day|day_name(true) }}<br>
|
||||||
{{ day.day|date_format('d.m') }}
|
{{ day.day|format_date('short') }}
|
||||||
</th>
|
</th>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</tr>
|
</tr>
|
||||||
|
|||||||
@@ -24,7 +24,7 @@
|
|||||||
{% for day in days %}
|
{% for day in days %}
|
||||||
<th class="text-center text-nowrap{% if day is weekend %} weekend{% endif %}">
|
<th class="text-center text-nowrap{% if day is weekend %} weekend{% endif %}">
|
||||||
{{ day|day_name(true) }}<br>
|
{{ day|day_name(true) }}<br>
|
||||||
{{ day|date_format('d.m') }}
|
{{ day|format_date('short') }}
|
||||||
</th>
|
</th>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</tr>
|
</tr>
|
||||||
|
|||||||
@@ -248,6 +248,7 @@
|
|||||||
{
|
{
|
||||||
if (durationMoment === null) {
|
if (durationMoment === null) {
|
||||||
getDurationField().value = '';
|
getDurationField().value = '';
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!durationMoment.isValid()) {
|
if (!durationMoment.isValid()) {
|
||||||
|
|||||||
Reference in New Issue
Block a user