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
<mbsc-input label="Name" placeholder="Required"></mbsc-datepicker>
<mbsc-input label="Card" placeholder="Credit card number"></mbsc-datepicker>
<mbsc-datepicker
[controls]="['date']"
dateFormat="MM/YYYY"
dateWheels="MMMM YYYY"
[min]="today"
[max]="until"
label="Expiration"
placeholder="Required" value="12/2025"
[ touchUi] =" ">
</mbsc-datepicker>
<mbsc-input label="Security" placeholder="3-digit CVV"></mbsc-datepicker>
const now = new Date();
today = new Date();
until = new Date(now.getFullYear() + 10, now.getMonth());
Add a new credit card
ComponentTemplate
import { CommonModule } from '@angular/common';
import { Component } from '@angular/core';
import { MbscModule, setOptions } from '@mobiscroll/angular';
setOptions({
locale: ,
theme: ' ',
themeVariant: ' '
});
const now = new Date();
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
standalone: true,
imports: [CommonModule, MbscModule],
})
export class AppComponent {
today = new Date();
until = new Date(now.getFullYear() + 10, now.getMonth());
}
<mbsc-page>
<div class="mbsc-form-group">
<div class="mbsc-form-group-title">Add a new credit card</div>
<mbsc-input label="Name" placeholder="Required"></mbsc-input>
<mbsc-input label="Card" placeholder="Credit card number"></mbsc-input>
<mbsc-datepicker
[controls]="['date']"
dateFormat="MM/YYYY"
dateWheels="DD MMMM YYYY"
[min]="today"
[max]="until"
label="Expiration"
placeholder="Required"
value="12/2025"
></mbsc-datepicker>
<mbsc-input label="Security" placeholder="3-digit CVV"></mbsc-input>
</div>
</mbsc-page>