This repository was archived by the owner on Jan 20, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtesting.js
More file actions
145 lines (123 loc) · 11.1 KB
/
Copy pathtesting.js
File metadata and controls
145 lines (123 loc) · 11.1 KB
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
/*
========================================================
██╗░░░░░░█████╗░░█████╗░░█████╗░██╗░░░░░███████╗░██████╗
██║░░░░░██╔══██╗██╔══██╗██╔══██╗██║░░░░░██╔════╝██╔════╝
██║░░░░░██║░░██║██║░░╚═╝███████║██║░░░░░█████╗░░╚█████╗░
██║░░░░░██║░░██║██║░░██╗██╔══██║██║░░░░░██╔══╝░░░╚═══██╗
███████╗╚█████╔╝╚█████╔╝██║░░██║███████╗███████╗██████╔╝
╚══════╝░╚════╝░░╚════╝░╚═╝░░╚═╝╚══════╝╚══════╝╚═════╝░
========================================================
*/
const USEng = new Intl.Locale('en-US');
const CAEng = new Intl.Locale('en-CA');
const German = new Intl.Locale('de-DE');
const Japanese = new Intl.Locale('ja-JA');
/*
=========================================
██████╗░░█████╗░████████╗███████╗░██████╗
██╔══██╗██╔══██╗╚══██╔══╝██╔════╝██╔════╝
██║░░██║███████║░░░██║░░░█████╗░░╚█████╗░
██║░░██║██╔══██║░░░██║░░░██╔══╝░░░╚═══██╗
██████╔╝██║░░██║░░░██║░░░███████╗██████╔╝
╚═════╝░╚═╝░░╚═╝░░░╚═╝░░░╚══════╝╚═════╝░
==========================================
*/
// const currentDate = new Date();
// const formatter = new Intl.DateTimeFormat(USEng);
// const formattedDate = formatter.format(currentDate);
// console.log(formattedDate) // Displays the current date as MM-DD-YYYY
// ==========================================================================================
// const options = {weekday: 'long', year: 'numeric', month: 'long', day: 'numeric'};
// const longerFormattedDate = new Intl.DateTimeFormat('en-us', options).format(currentDate);
// console.log(longerFormattedDate);
/*
===============================
████████╗██╗███╗░░░███╗███████╗
╚══██╔══╝██║████╗░████║██╔════╝
░░░██║░░░██║██╔████╔██║█████╗░░
░░░██║░░░██║██║╚██╔╝██║██╔══╝░░
░░░██║░░░██║██║░╚═╝░██║███████╗
░░░╚═╝░░░╚═╝╚═╝░░░░░╚═╝╚══════╝
===============================
*/
// const currentTime = Date.now();
// 24 Hour Time:
// const options = {hour: 'numeric', minute: 'numeric', hour12: false};
// 12 Hour Time:
// const options = {hour: 'numeric', minute: 'numeric'};
// const formattedTime = new Intl.DateTimeFormat('en', options).format(currentTime);
// console.log(formattedTime);
/*
==============================================================================================
██████╗░███████╗██╗░░░░░░█████╗░████████╗██╗██╗░░░██╗███████╗ ████████╗██╗███╗░░░███╗███████╗
██╔══██╗██╔════╝██║░░░░░██╔══██╗╚══██╔══╝██║██║░░░██║██╔════╝ ╚══██╔══╝██║████╗░████║██╔════╝
██████╔╝█████╗░░██║░░░░░███████║░░░██║░░░██║╚██╗░██╔╝█████╗░░ ░░░██║░░░██║██╔████╔██║█████╗░░
██╔══██╗██╔══╝░░██║░░░░░██╔══██║░░░██║░░░██║░╚████╔╝░██╔══╝░░ ░░░██║░░░██║██║╚██╔╝██║██╔══╝░░
██║░░██║███████╗███████╗██║░░██║░░░██║░░░██║░░╚██╔╝░░███████╗ ░░░██║░░░██║██║░╚═╝░██║███████╗
╚═╝░░╚═╝╚══════╝╚══════╝╚═╝░░╚═╝░░░╚═╝░░░╚═╝░░░╚═╝░░░╚══════╝ ░░░╚═╝░░░╚═╝╚═╝░░░░░╚═╝╚══════╝
==============================================================================================
*/
// const currentTime = new Date();
// setTimeout(() => {
// const newTime = new Date();
// const relativeFormatter = new Intl.RelativeTimeFormat('en-us');
// const secondsAgo = relativeFormatter.format((currentTime - newTime) / 1000, 'second');
// console.log(secondsAgo);
// }, 2000)
/*
==================================================================================
███╗░░██╗██╗░░░██╗███╗░░░███╗██████╗░███████╗██████╗░
████╗░██║██║░░░██║████╗░████║██╔══██╗██╔════╝██╔══██╗
██╔██╗██║██║░░░██║██╔████╔██║██████╦╝█████╗░░██████╔╝
██║╚████║██║░░░██║██║╚██╔╝██║██╔══██╗██╔══╝░░██╔══██╗
██║░╚███║╚██████╔╝██║░╚═╝░██║██████╦╝███████╗██║░░██║
╚═╝░░╚══╝░╚═════╝░╚═╝░░░░░╚═╝╚═════╝░╚══════╝╚═╝░░╚═╝
███████╗░█████╗░██████╗░███╗░░░███╗░█████╗░████████╗████████╗██╗███╗░░██╗░██████╗░
██╔════╝██╔══██╗██╔══██╗████╗░████║██╔══██╗╚══██╔══╝╚══██╔══╝██║████╗░██║██╔════╝░
█████╗░░██║░░██║██████╔╝██╔████╔██║███████║░░░██║░░░░░░██║░░░██║██╔██╗██║██║░░██╗░
██╔══╝░░██║░░██║██╔══██╗██║╚██╔╝██║██╔══██║░░░██║░░░░░░██║░░░██║██║╚████║██║░░╚██╗
██║░░░░░╚█████╔╝██║░░██║██║░╚═╝░██║██║░░██║░░░██║░░░░░░██║░░░██║██║░╚███║╚██████╔╝
╚═╝░░░░░░╚════╝░╚═╝░░╚═╝╚═╝░░░░░╚═╝╚═╝░░╚═╝░░░╚═╝░░░░░░╚═╝░░░╚═╝╚═╝░░╚══╝░╚═════╝░
==================================================================================
*/
// const amount = 213267;
// const Euros = new Intl.NumberFormat(German, { style: 'currency', currency: 'EUR' });
// const Yen = new Intl.NumberFormat(Japanese, { style: 'currency', currency: 'JPY' });
// const Dollars = new Intl.NumberFormat(USEng, {style: 'currency', currency: 'USD'});
// console.log(Euros.format(amount))
// console.log(Yen.format(amount))
// console.log(Dollars.format(amount))
/*
============================================================================================
██████╗░██╗░░░░░██╗░░░██╗██████╗░░█████╗░██╗░░░░░ ██████╗░██╗░░░██╗██╗░░░░░███████╗░██████╗
██╔══██╗██║░░░░░██║░░░██║██╔══██╗██╔══██╗██║░░░░░ ██╔══██╗██║░░░██║██║░░░░░██╔════╝██╔════╝
██████╔╝██║░░░░░██║░░░██║██████╔╝███████║██║░░░░░ ██████╔╝██║░░░██║██║░░░░░█████╗░░╚█████╗░
██╔═══╝░██║░░░░░██║░░░██║██╔══██╗██╔══██║██║░░░░░ ██╔══██╗██║░░░██║██║░░░░░██╔══╝░░░╚═══██╗
██║░░░░░███████╗╚██████╔╝██║░░██║██║░░██║███████╗ ██║░░██║╚██████╔╝███████╗███████╗██████╔╝
╚═╝░░░░░╚══════╝░╚═════╝░╚═╝░░╚═╝╚═╝░░╚═╝╚══════╝ ╚═╝░░╚═╝░╚═════╝░╚══════╝╚══════╝╚═════╝░
============================================================================================
*/
// var pr = new Intl.PluralRules('en-us', { type: 'ordinal' });
// console.log(pr.select(0))
// console.log(pr.select(1))
// console.log(pr.select(2))
// console.log(pr.select(3))
// console.log(pr.select(4))
// console.log(pr.select(63))
// ================================================================
// const place = function(number) {
// const rules = {
// other: 'th',
// one: 'st',
// two: 'nd',
// few: 'rd',
// };
// return number + rules[pr.select(number)]
// }
// console.log(place(0));
// console.log(place(1));
// console.log(place(2));
// console.log(place(3));
// console.log(place(4));
// console.log(place(45));
// console.log(place(31));