#6917 - inputDate_inputTime_improviments #552

Merged
alexm merged 8 commits from 6917-inputDate_inputTime_improviments into test 2024-07-16 11:12:55 +00:00
2 changed files with 21 additions and 9 deletions
Showing only changes of commit ea3effd7f4 - Show all commits

View File

@ -407,7 +407,7 @@ defineExpose({
<VnTableColumn
:column="col"
:row="row"
:is-editable="false"
:is-editable="col.isEditable ?? isEditable"
v-model="row[col.name]"
component-prop="columnField"
/>

View File

@ -44,12 +44,15 @@ const formattedDate = computed({
let newDate;
if (value) {
// parse input
if (value.includes('/') && value.length >= 10) {
if (value.at(2) == '/') value = value.split('/').reverse().join('/');
value = date.formatDate(
new Date(value).toISOString(),
'YYYY-MM-DDTHH:mm:ss.SSSZ'
);
if (value.includes('/')) {
if (value.length == 6) value = value + new Date().getFullYear();
if (value.length >= 10) {
if (value.at(2) == '/') value = value.split('/').reverse().join('/');
value = date.formatDate(
new Date(value).toISOString(),
'YYYY-MM-DDTHH:mm:ss.SSSZ'
);
}
}
let ymd = value.split('-').map((e) => parseInt(e));
alexm marked this conversation as resolved Outdated

porque no es const?
ymd?? year-month-day==

Propuesta
const [year, mont, day] = value.split

porque no es const? ymd?? year-month-day== Propuesta const [year, mont, day] = value.split
Outdated
Review

Era código de Juan.
Pero si en este caso si se puede cambiar

Era código de Juan. Pero si en este caso si se puede cambiar
newDate = new Date(ymd[0], ymd[1] - 1, ymd[2]);
@ -107,7 +110,12 @@ watch(
isPopupOpen = false;
"
/>
<QIcon name="event" class="cursor-pointer" />
<QIcon
name="event"
class="cursor-pointer"
@click="isPopupOpen = !isPopupOpen"
:title="t('Open date')"
/>
</template>
<QMenu
transition-show="scale"
@ -116,6 +124,7 @@ watch(
anchor="bottom left"
self="top start"
:no-focus="true"
:no-parent-event="true"
>
<QDate
v-model="popupDate"
@ -132,7 +141,6 @@ watch(
</QInput>
</div>
</template>
<style lang="scss">
.vn-input-date.q-field--standard.q-field--readonly .q-field__control:before {
border-bottom-style: solid;
@ -142,3 +150,7 @@ watch(
border-style: solid;
}
</style>
<i18n>
es:
Open date: Abrir fecha
</i18n>