Credit card expiration
Customize the wheels and format the date picker for month & year. Choose a month/year format for the credit card expiration date.
This and even more can be done with the dateWheels setting.
Interested in changing the date format? Explore formatting options →
Demo
html<div class="mbsc-form-group">
<div class="mbsc-form-group-title">Add a new credit card</div>
<label>
Name
<input mbsc-input type="text" placeholder="Required" />
</label>
<label>
Card
<input mbsc-input type="text" placeholder="Credit card number" />
</label>
<label>
Expiration
<input mbsc-input id="picker" type="text" placeholder="Required" value="12/2025" />
</label>
<label>
Security
<input mbsc-input type="text" placeholder="3-digit CVV" />
</label>
</div>
jsvar now = new Date(),
until = new Date(now.getFullYear() + 10, now.getMonth());
mobiscroll.datepicker('#picker', {
controls: ['date'],
dateFormat: 'MM/YYYY',
dateWheels: 'MMMM YYYY',
min: now,
max: until,
touchUi:
});
Add a new credit card
JSHTML
mobiscroll.setOptions({
locale: ,
theme: ' ',
themeVariant: ' '
});
var now = new Date();
var until = new Date(now.getFullYear() + 10, now.getMonth());
mobiscroll.datepicker('#picker', {
controls: ['date'],
dateFormat: 'MM/YYYY',
dateWheels: 'DD MMMM YYYY',
min: now,
minWidth: 100,
max: until,
});
<div class="mbsc-form-group">
<div class="mbsc-form-group-title">Add a new credit card</div>
<label>
Name
<input mbsc-input type="text" placeholder="Required" />
</label>
<label>
Card
<input mbsc-input type="text" placeholder="Credit card number" />
</label>
<label>
Expiration
<input mbsc-input id="picker" type="text" placeholder="Required" value="12/2025"/>
</label>
<label>
Security
<input mbsc-input type="text" placeholder="3-digit CVV" />
</label>
</div>