Skip to content

bug: An empty ion-datetime value gives a default date of May 2021 #29669

Closed
@mpaland

Description

@mpaland

Prerequisites

Ionic Framework Version

v8.x

Current Behavior

Using Ionic/Vue 8.2.3,

<ion-datetime :show-default-buttons="true" v-model="src.txt" @ionChange="onUpdate()"></ion-datetime>

when src.txtis an empty string, the default date is "May 2021", no day selected.

Expected Behavior

I would recommend, to set the default month, year to the actual date (in the moment like "June 2024").

Steps to Reproduce

Open an ion-datetime control with an empty string as value.

Code Reproduction URL

https://stackblitz.com/edit/lhlzcu?file=src%2Fcomponents%2FExample.vue

Ionic Info

Ionic:

Ionic CLI : 7.2.0 (C:\Users\Marco\AppData\Roaming\npm\node_modules@ionic\cli)
Ionic Framework : @ionic/vue 8.2.3

Capacitor:

Capacitor CLI : 6.1.0
@capacitor/android : not installed
@capacitor/core : 6.1.0
@capacitor/ios : not installed

Utility:

cordova-res : not installed globally
native-run : 2.0.1

System:

NodeJS : v20.11.0 (D:\nodejs\node.exe)
npm : 10.8.1
OS : Windows 10

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions