-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathvariables.txt
23 lines (16 loc) · 1.28 KB
/
variables.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# Day of the week
day = javascript:(() => { const days = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday']; return days[new Date().getDay()] })()
# Month name
month = javascript:(() => { const months = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']; return months[new Date().getMonth()] })()
# Long date (e.g., "Monday, January 17, 2022" -- format is region-specific)
long_date = javascript:new Date().toLocaleDateString('en-us', { weekday: 'long', year: 'numeric', month: 'long', day: 'numeric' })
# Short date (e.g., "1/17/2022" -- format is region-specific)
short_date = javascript:new Date().toLocaleDateString()
# Time (e.g., "8:00:00 PM" -- format is region-specific)
time = javascript:new Date().toLocaleTimeString()
# Time-based greeting ("Good morning" before 12PM, "Good afternoon" 12-6PM, "Good evening" after 6PM)
greeting = javascript:(() => { const hour = new Date().getHours(); return hour < 12 ? 'Good morning' : (hour >= 12 && hour <= 18 ? 'Good afternoon' : 'Good evening') })()
# Random alphanumeric (e.g., "e5yk80p9x57")
rand_alphanumeric = javascript:Math.random().toString(36).slice(2)
# Random number between 1-10
rand_1_10 = javascript:Math.floor(Math.random() * 10 + 1)