本文整理汇总了TypeScript中@angular/common.formatDate函数的典型用法代码示例。如果您正苦于以下问题:TypeScript formatDate函数的具体用法?TypeScript formatDate怎么用?TypeScript formatDate使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了formatDate函数的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: updateData
updateData() {
const time: Date = new Date(),
formattedTime = formatDate(time, 'HH:mm:ss', 'en'),
random = getRandomInt(1, 40),
data = this.data.series[0],
labels = this.data.labels;
labels.push(formattedTime);
data.push(random);
// We only want to display 10 data points at a time
this.data.labels = labels.slice(-9);
this.data.series[0] = data.slice(-9);
this.data = { ...this.data };
}
示例2: dayViewHour
/**
* The time formatting down the left hand side of the day view
*/
public dayViewHour({ date, locale }: DateFormatterParams): string {
return formatDate(date, 'h a', locale);
}
示例3: dayViewTitle
/**
* The day view title
*/
public dayViewTitle({ date, locale }: DateFormatterParams): string {
return formatDate(date, 'EEEE, MMMM d, y', locale);
}
示例4: formatDate
const format = (dateToFormat: Date, showYear: boolean) =>
formatDate(dateToFormat, 'MMM d' + (showYear ? ', yyyy' : ''), locale);
示例5: weekViewColumnSubHeader
/**
* The week view sub header day and month labels
*/
public weekViewColumnSubHeader({
date,
locale
}: DateFormatterParams): string {
return formatDate(date, 'MMM d', locale);
}
示例6: monthViewTitle
/**
* The month view title
*/
public monthViewTitle({ date, locale }: DateFormatterParams): string {
return formatDate(date, 'LLLL y', locale);
}
示例7: monthViewDayNumber
/**
* The month view cell day number
*/
public monthViewDayNumber({ date, locale }: DateFormatterParams): string {
return formatDate(date, 'd', locale);
}
示例8: monthViewColumnHeader
/**
* The month view header week day labels
*/
public monthViewColumnHeader({ date, locale }: DateFormatterParams): string {
return formatDate(date, 'EEEE', locale);
}