react-dates
Version:
A responsive and accessible date range picker component built with React
8 lines • 346 B
JavaScript
import moment from 'moment';
import toMomentObject from './toMomentObject';
import { ISO_MONTH_FORMAT } from '../constants';
export default function toISOMonthString(date, currentFormat) {
var dateObj = moment.isMoment(date) ? date : toMomentObject(date, currentFormat);
if (!dateObj) return null;
return dateObj.format(ISO_MONTH_FORMAT);
}