ejs stuff
This commit is contained in:
10
functions.js
Normal file
10
functions.js
Normal file
@@ -0,0 +1,10 @@
|
||||
// The configuration defines a date format using the date-fns (a datetime library) syntax
|
||||
// eg "yyyy-MM-dd"
|
||||
// this converts unix time (an integer) into a string that is formatted according to config.js
|
||||
// uses date-fns's fromUnixTime() and format() functions
|
||||
// returns the formatted date (string)
|
||||
export function unix_time_to_date_format(unix_time, format) {
|
||||
date = fromUnixTime(unix_time)
|
||||
formatted_date = format(date, format)
|
||||
return formatted_date
|
||||
}
|
Reference in New Issue
Block a user