mirror of
https://gitee.com/vant-contrib/vant-weapp.git
synced 2025-04-06 03:58:05 +08:00
34 lines
684 B
XML
34 lines
684 B
XML
/* eslint-disable */
|
|
function formatDate(date) {
|
|
if (date) {
|
|
date = getDate(date);
|
|
return date.getMonth() + 1 + '/' + date.getDate();
|
|
}
|
|
}
|
|
|
|
function formatFullDate(date) {
|
|
if (date) {
|
|
date = getDate(date);
|
|
return date.getFullYear() + '/' + formatDate(date);
|
|
}
|
|
}
|
|
|
|
function formatMultiple(dates) {
|
|
if (dates.length) {
|
|
return '选择了 ' + dates.length + '个日期';
|
|
}
|
|
}
|
|
|
|
function formatRange(dateRange) {
|
|
if (dateRange.length) {
|
|
return formatDate(dateRange[0]) + ' - ' + formatDate(dateRange[1]);
|
|
}
|
|
}
|
|
|
|
module.exports = {
|
|
formatDate: formatDate,
|
|
formatFullDate: formatFullDate,
|
|
formatMultiple: formatMultiple,
|
|
formatRange: formatRange
|
|
};
|