-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdate.js
26 lines (20 loc) · 864 Bytes
/
date.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
module.exports.getDate=function(){
const today = new Date();
// week=['Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday'];
let options={
weekday:"long",
day:"numeric",
month:"long"
};
// const day=today.toLocaleDateString("en-US",options); //this is modern date string function which i just customized using options parameter.
return today.toLocaleDateString("en-US",options);
};
module.exports.getDay=function(){
const today = new Date();
// week=['Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday'];
let options={
weekday:"long"
};
// const day=today.toLocaleDateString("en-US",options); //this is modern date string function which i just customized using options parameter.
return today.toLocaleDateString("en-US",options);
};