Function
Static Public Summary | ||
public |
增加N天后的日期 |
|
public |
增加N月后的日期 |
|
public |
日期转字符串 |
|
public |
获取所允许的时间区间 |
|
public |
getDayOfWeek(d: Date): string 获取星期字符串 |
|
public |
getDaysInMonth(d: Date): number 获取某一月的天数 |
|
public |
getFirstDayOfMonth(d: Date): Date 获取某月第一天的日期对象 |
|
public |
getFullWeekArray(d: Date): Array 得到某一月所有天数按周组成若干个数组 第一周和最后一周不在本月的天数 |
|
public |
getNextTime(time: Date, unit: string): Date 处理时间对象,返回当前单位下下一个值 |
|
public |
getShortMonth(d: Date): string 获取月份字符串 |
|
public |
isAfterDate(d1: Date, d2: Date): boolean 判断两个日期对象的大小 |
|
public |
isAfterMonth(d1: Date, d2: Date): boolean 判断两个日期对象大小 |
|
public |
isBeforeDate(d1: Date, d2: Date): boolean 判断两个日期对象的大小 |
|
public |
isBeforeMonth(d1: Date, d2: Date): boolean 判断两个日期对象大小 |
|
public |
是否为 Date 实例 |
|
public |
isEqualDate(d1: Date, d2: Date): boolean 判断两个日期对象是否为同一天 |
|
public |
isEqualMonth(d1: Date, d2: Date): boolean 判断两个日期对象是否在同一个月 |
|
public |
判断日期之间相差的月数 |
|
public |
处理时间对象,只留下当前单位需要的部分 |
|
public |
字符串转日期 |
|
public |
判断日期之间相差的年数 |
Static Public
public addDays(d: Date, days: number): Date source
import {addDays} from 'melon-calendar/src/util.js'
增加N天后的日期
public addMonths(d: Date, months: number): Date source
import {addMonths} from 'melon-calendar/src/util.js'
增加N月后的日期
public format(date: Date, format: string): string source
import {format} from 'melon-calendar/src/util.js'
日期转字符串
public getContinuousFragments(begin: Date, end: Date, unit: string): Array<Date> source
import {getContinuousFragments} from 'melon-calendar/src/UnitCalendar.js'
获取所允许的时间区间
public getDayOfWeek(d: Date): string source
import {getDayOfWeek} from 'melon-calendar/src/util.js'
获取星期字符串
Params:
Name | Type | Attribute | Description |
d | Date | 日期 |
public getDaysInMonth(d: Date): number source
import {getDaysInMonth} from 'melon-calendar/src/util.js'
获取某一月的天数
Params:
Name | Type | Attribute | Description |
d | Date | 日期 |
public getFirstDayOfMonth(d: Date): Date source
import {getFirstDayOfMonth} from 'melon-calendar/src/util.js'
获取某月第一天的日期对象
Params:
Name | Type | Attribute | Description |
d | Date | Date对象 |
public getFullWeekArray(d: Date): Array source
import {getFullWeekArray} from 'melon-calendar/src/util.js'
得到某一月所有天数按周组成若干个数组 第一周和最后一周不在本月的天数
Params:
Name | Type | Attribute | Description |
d | Date | 日期 |
public getNextTime(time: Date, unit: string): Date source
import {getNextTime} from 'melon-calendar/src/UnitCalendar.js'
处理时间对象,返回当前单位下下一个值
public getShortMonth(d: Date): string source
import {getShortMonth} from 'melon-calendar/src/util.js'
获取月份字符串
Params:
Name | Type | Attribute | Description |
d | Date | 日期 |
public isAfterDate(d1: Date, d2: Date): boolean source
import {isAfterDate} from 'melon-calendar/src/util.js'
判断两个日期对象的大小
public isAfterMonth(d1: Date, d2: Date): boolean source
import {isAfterMonth} from 'melon-calendar/src/util.js'
判断两个日期对象大小
public isBeforeDate(d1: Date, d2: Date): boolean source
import {isBeforeDate} from 'melon-calendar/src/util.js'
判断两个日期对象的大小
public isBeforeMonth(d1: Date, d2: Date): boolean source
import {isBeforeMonth} from 'melon-calendar/src/util.js'
判断两个日期对象大小
public isDate(date: Date): boolean source
import {isDate} from 'melon-calendar/src/util.js'
是否为 Date 实例
Params:
Name | Type | Attribute | Description |
date | Date | 一个对象 |
public isEqualDate(d1: Date, d2: Date): boolean source
import {isEqualDate} from 'melon-calendar/src/util.js'
判断两个日期对象是否为同一天
public isEqualMonth(d1: Date, d2: Date): boolean source
import {isEqualMonth} from 'melon-calendar/src/util.js'
判断两个日期对象是否在同一个月
public monthDiff(d1: Date, d2: Date): number source
import {monthDiff} from 'melon-calendar/src/util.js'
判断日期之间相差的月数
public normalize(time: Date, unit: string): Date source
import {normalize} from 'melon-calendar/src/UnitCalendar.js'
处理时间对象,只留下当前单位需要的部分
public parse(value: string, format: string): Date source
import {parse} from 'melon-calendar/src/util.js'
字符串转日期