yearMonth static method
DateTimeFormatter
yearMonth({
- Locale? locale,
- DateTimeAlignment? alignment,
- DateTimeLength? length,
- YearStyle? yearStyle,
Formatting the year and month.
Example:
import 'package:intl4x/datetime_format.dart';
void main() {
final date = DateTime(2021, 12, 17, 4, 0, 42);
print(DateTimeFormat.yearMonth().format(date)); // Output: 'Dec 2021'
}
Implementation
static DateTimeFormatter yearMonth({
Locale? locale,
DateTimeAlignment? alignment,
DateTimeLength? length,
YearStyle? yearStyle,
}) => DateTimeFormatImpl.build(
locale ?? findSystemLocale(),
).ym(alignment: alignment, length: length, yearStyle: yearStyle);