You can use the native .toLocaleDateString() function which supports several useful params like locale (to select a format like MM/DD/YYYY or ... ... <看更多>
var x = new Date(); var y = x. ... getFullYear().toString(); var m = (x. ... getMonth() + 1).toString(); var d = x. ... getDate().toString(); (d. ... <看更多>
yesterday(format: string = "YYYY-MM-DD"). Retrieves yesterday's date. Arguments. format : Format for the date, refer to format reference. Moment.js. ... <看更多>