本文整理汇总了TypeScript中datejs.parse函数的典型用法代码示例。如果您正苦于以下问题:TypeScript parse函数的具体用法?TypeScript parse怎么用?TypeScript parse使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了parse函数的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: getDaysBetween
getDaysBetween(start_date, end_date) {
let is_today = this.isDateToday(start_date);
let le_date = [{ day: Date.parse(start_date), is_today: is_today,label:null }];
le_date[0].label = le_date[0].day.toString("dddd \n\r d/MM")
while (le_date[le_date.length -1].day.toString() != end_date.toString()){
let next_day = Date.parse(le_date[le_date.length - 1].day).add(1).days();
let is_today = this.isDateToday(next_day);
le_date.push({ label:next_day.toString("dddd \n\r d/MM"),day:next_day,is_today:is_today });
}
return le_date;
}
示例2: getStartOfWeek
private getStartOfWeek(date = false) {
let monday = null;
if(date){
monday = Date.parse(date)
}else{
monday = Date.today();
}
if(monday.is().mon()){
return monday;
}
return monday.last().mon();
}
示例3: getEndOfWeek
private getEndOfWeek(date = false) {
let sunday = null;
if (date) {
sunday = Date.parse(date)
} else {
sunday = Date.today();
}
if (sunday.is().sun()) {
return sunday;
}
return sunday.next().sun();
}
示例4: getMonthofDate
private getMonthofDate(date){
return Date.parse(date).toString("MMMM")
}
示例5: isDateToday
private isDateToday(date){
return (Date.today().toString() == Date.parse(date).toString());
}
示例6: geyWeekOfDate
private geyWeekOfDate(date){
return Date.parse(date).getWeek();
}
示例7: getYearofDate
private getYearofDate(date){
return Date.parse(date).toString("yyyy")
}