Skip to content

Commit 43b1ef1

Browse files
committed
Month and Day
1 parent a61a39c commit 43b1ef1

File tree

3 files changed

+48
-8
lines changed

3 files changed

+48
-8
lines changed

dist/easycoder-min.js

Lines changed: 8 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/easycoder.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3141,6 +3141,26 @@ const EasyCoder_Core = {
31413141
numeric: true,
31423142
content: year
31433143
};
3144+
case `month`:
3145+
var month = new Date().getMonth();
3146+
if (value.timestamp) {
3147+
month = new Date(program.getValue(value.timestamp) * 1000).getMonth();
3148+
}
3149+
return {
3150+
type: `constant`,
3151+
numeric: true,
3152+
content: month
3153+
};
3154+
case `day`:
3155+
var day = new Date().getDay();
3156+
if (value.timestamp) {
3157+
day = new Date(program.getValue(value.timestamp) * 1000).getDay();
3158+
}
3159+
return {
3160+
type: `constant`,
3161+
numeric: true,
3162+
content: day
3163+
};
31443164
case `hour`:
31453165
var hour = new Date().getHours();
31463166
if (value.timestamp) {

js/easycoder/Core.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3141,6 +3141,26 @@ const EasyCoder_Core = {
31413141
numeric: true,
31423142
content: year
31433143
};
3144+
case `month`:
3145+
var month = new Date().getMonth();
3146+
if (value.timestamp) {
3147+
month = new Date(program.getValue(value.timestamp) * 1000).getMonth();
3148+
}
3149+
return {
3150+
type: `constant`,
3151+
numeric: true,
3152+
content: month
3153+
};
3154+
case `day`:
3155+
var day = new Date().getDay();
3156+
if (value.timestamp) {
3157+
day = new Date(program.getValue(value.timestamp) * 1000).getDay();
3158+
}
3159+
return {
3160+
type: `constant`,
3161+
numeric: true,
3162+
content: day
3163+
};
31443164
case `hour`:
31453165
var hour = new Date().getHours();
31463166
if (value.timestamp) {

0 commit comments

Comments
 (0)