Merge branch 'master' of github.com:chamilo/chamilo-lms

pull/5671/head
Yannick Warnier 2 years ago
commit 52d7854199
  1. 5
      assets/vue/components/basecomponents/BaseInputText.vue
  2. 1
      assets/vue/components/basecomponents/BaseSelect.vue
  3. 1
      assets/vue/components/basecomponents/BaseTextArea.vue
  4. 1
      assets/vue/components/documents/Form.vue
  5. 17
      assets/vue/composables/formatDate.js
  6. 3
      assets/vue/composables/locale.js
  7. 2
      src/CoreBundle/Entity/ResourceLink.php

@ -10,10 +10,7 @@
type="text"
@update:model-value="updateValue"
/>
<label
:for="id"
:class="{ 'p-error': isInvalid }"
>
<label :for="id">
{{ label }}
</label>
</div>

@ -20,7 +20,6 @@
</Dropdown>
<label
v-t="label"
:class="{ 'p-error': isInvalid }"
:for="id"
/>
</FloatLabel>

@ -11,7 +11,6 @@
/>
<label
v-t="label"
:class="{ 'p-error': isInvalid }"
:for="id"
/>
</div>

@ -9,7 +9,6 @@
/>
<label
v-t="'Title'"
:class="{ 'p-error': v$.item.title.$invalid }"
for="item_title"
/>
</div>

@ -1,18 +1,23 @@
const { DateTime } = require("luxon")
import { DateTime } from "luxon"
import { useLocale } from "./locale"
export function useFormatDate() {
const { appParentLocale } = useLocale()
const abbreviatedDatetime = (datetime) => {
if (!datetime) {
return ""
}
return DateTime.fromISO(datetime).toLocaleString({
...DateTime.DATETIME_MED,
month: "long",
})
return DateTime.fromISO(datetime)
.setLocale(appParentLocale.value)
.toLocaleString({
...DateTime.DATETIME_MED,
month: "long",
})
}
const relativeDatetime = (datetime) => DateTime.fromISO(datetime).toRelative()
const relativeDatetime = (datetime) => DateTime.fromISO(datetime).setLocale(appParentLocale.value).toRelative()
return {
abbreviatedDatetime,

@ -84,8 +84,11 @@ export function useLocale() {
window.location.href = newUrl.fullPath
}
const appParentLocale = computed(() => useParentLocale(appLocale.value))
return {
appLocale,
appParentLocale,
languageList,
currentLanguageFromList,
reloadWithLocale,

@ -43,7 +43,7 @@ class ResourceLink implements Stringable
protected ResourceNode $resourceNode;
#[Gedmo\SortableGroup]
#[ORM\ManyToOne(targetEntity: Course::class, cascade: ['persist'])]
#[ORM\ManyToOne(targetEntity: Course::class)]
#[ORM\JoinColumn(name: 'c_id', referencedColumnName: 'id', nullable: true, onDelete: 'CASCADE')]
protected ?Course $course = null;

Loading…
Cancel
Save