Skip to content

Commit

Permalink
fix(PWA): replace datepicker with input component
Browse files Browse the repository at this point in the history
- update & min max value breaking
  • Loading branch information
ruchamahabal committed Oct 30, 2024
1 parent 97559c3 commit 5d424c5
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions frontend/src/components/FormField.vue
Original file line number Diff line number Diff line change
Expand Up @@ -108,13 +108,15 @@
</div>

<!-- Date -->
<!-- FIXME: min date, max date doesn't work -->
<DatePicker
<!-- FIXME: default datepicker has poor UI -->
<Input
v-else-if="props.fieldtype === 'Date'"
type="date"
:value="modelValue"
:placeholder="__('Select {0}', [props.label])"
:formatter="(val) => dayjs(val).format('DD-MM-YYYY')"
@update:modelValue="(v) => emit('update:modelValue', v)"
:formatValue="(val) => dayjs(val).format('DD-MM-YYYY')"
@input="(v) => emit('update:modelValue', v)"
@change="(v) => emit('change', v)"
v-bind="$attrs"
:disabled="isReadOnly"
:min="props.minDate"
Expand All @@ -138,7 +140,7 @@
</template>

<script setup>
import { Autocomplete, DatePicker, DateTimePicker, ErrorMessage } from "frappe-ui"
import { Autocomplete, DateTimePicker ErrorMessage, Input } from "frappe-ui"
import { computed, onMounted, inject } from "vue"
import Link from "@/components/Link.vue"
Expand Down

0 comments on commit 5d424c5

Please sign in to comment.