@cuemath/web-utils 0.0.2-beta.10 → 0.0.2-beta.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (65) hide show
  1. package/.husky/pre-commit +0 -1
  2. package/.vscode/settings.json +1 -0
  3. package/dist/index.js +1 -6
  4. package/package.json +12 -23
  5. package/src/cookie/index.ts +10 -4
  6. package/src/growth-source/index.ts +191 -0
  7. package/src/growth-source/types.ts +33 -0
  8. package/src/index.ts +1 -6
  9. package/.eslintignore +0 -2
  10. package/.huskyrc +0 -5
  11. package/.lintstagedrc.yml +0 -5
  12. package/src/constants/country/index.ts +0 -2
  13. package/src/constants/country/iso-country-code.ts +0 -248
  14. package/src/constants/date-time/index.ts +0 -43
  15. package/src/constants/date-time/international-timezones.ts +0 -157
  16. package/src/constants/e-cna/index.ts +0 -55
  17. package/src/constants/index.ts +0 -2
  18. package/src/country/index.ts +0 -9
  19. package/src/date-time-helper/e-cna.ts +0 -205
  20. package/src/date-time-helper/index.ts +0 -365
  21. package/src/e-cna/flow/aggregator.ts +0 -12
  22. package/src/e-cna/flow/index.ts +0 -1
  23. package/src/e-cna/flow/variants/default.ts +0 -113
  24. package/src/e-cna/flow/variants/index.ts +0 -1
  25. package/src/e-cna/index.ts +0 -249
  26. package/src/e-cna/slides/child_hobbies/index.ts +0 -1
  27. package/src/e-cna/slides/child_hobbies/variants.ts +0 -24
  28. package/src/e-cna/slides/child_info/index.ts +0 -1
  29. package/src/e-cna/slides/child_info/variants.ts +0 -18
  30. package/src/e-cna/slides/child_personality/index.ts +0 -1
  31. package/src/e-cna/slides/child_personality/variants.ts +0 -12
  32. package/src/e-cna/slides/curriculum/index.ts +0 -1
  33. package/src/e-cna/slides/curriculum/variants.ts +0 -14
  34. package/src/e-cna/slides/grade/index.ts +0 -1
  35. package/src/e-cna/slides/grade/variants.ts +0 -29
  36. package/src/e-cna/slides/index.ts +0 -19
  37. package/src/e-cna/slides/intro/index.ts +0 -1
  38. package/src/e-cna/slides/intro/variants.ts +0 -7
  39. package/src/e-cna/slides/key_need_l1/index.ts +0 -1
  40. package/src/e-cna/slides/key_need_l1/variants.ts +0 -57
  41. package/src/e-cna/slides/key_need_l2/index.ts +0 -1
  42. package/src/e-cna/slides/key_need_l2/variants.ts +0 -143
  43. package/src/e-cna/slides/key_need_l3/index.ts +0 -1
  44. package/src/e-cna/slides/key_need_l3/variants.ts +0 -13
  45. package/src/e-cna/slides/math-perception/index.ts +0 -1
  46. package/src/e-cna/slides/math-perception/variants.ts +0 -30
  47. package/src/e-cna/slides/other_curriculum/index.ts +0 -1
  48. package/src/e-cna/slides/other_curriculum/variants.ts +0 -14
  49. package/src/e-cna/slides/school_performance_5_12/index.ts +0 -1
  50. package/src/e-cna/slides/school_performance_5_12/variants.ts +0 -23
  51. package/src/e-cna/slides/school_performance_kg_4/index.ts +0 -1
  52. package/src/e-cna/slides/school_performance_kg_4/variants.ts +0 -25
  53. package/src/e-cna/slides/secondary_needs/index.ts +0 -1
  54. package/src/e-cna/slides/secondary_needs/variants.ts +0 -26
  55. package/src/e-cna/slides/signup/index.ts +0 -1
  56. package/src/e-cna/slides/signup/variants.ts +0 -7
  57. package/src/e-cna/slides/signup_refer/index.ts +0 -1
  58. package/src/e-cna/slides/signup_refer/variants.ts +0 -16
  59. package/src/e-cna/slides/slot_pick/index.ts +0 -1
  60. package/src/e-cna/slides/slot_pick/variants.ts +0 -12
  61. package/src/e-cna/slides/teacher_intro/index.ts +0 -1
  62. package/src/e-cna/slides/teacher_intro/variants.ts +0 -114
  63. package/src/e-cna/utils/index.ts +0 -32
  64. package/src/local-storage/index.ts +0 -186
  65. package/src/object/index.ts +0 -26
package/.husky/pre-commit CHANGED
@@ -2,4 +2,3 @@
2
2
  . "$(dirname -- "$0")/_/husky.sh"
3
3
 
4
4
  yarn lint
5
- npx lint-staged
@@ -0,0 +1 @@
1
+ {}
package/dist/index.js CHANGED
@@ -15,10 +15,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./cookie"), exports);
18
- __exportStar(require("./constants"), exports);
19
- __exportStar(require("./local-storage"), exports);
20
- __exportStar(require("./e-cna"), exports);
21
- __exportStar(require("./date-time-helper"), exports);
22
- __exportStar(require("./country"), exports);
23
- __exportStar(require("./object"), exports);
18
+ __exportStar(require("./growth-source"), exports);
24
19
  //# sourceMappingURL=index.js.map
package/package.json CHANGED
@@ -1,53 +1,42 @@
1
1
  {
2
2
  "name": "@cuemath/web-utils",
3
- "version": "0.0.2-beta.10",
4
- "description": "Shareable utils package",
3
+ "version": "0.0.2-beta.3",
4
+ "description": "Shared web utils package",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
7
7
  "lint": "tsc --noEmit && eslint 'src/**/*.{js,jsx,ts,tsx,json}'",
8
8
  "build": "tsc",
9
9
  "build-watch": "tsc -w",
10
10
  "prepublishOnly": "rm -rf dist && yarn build",
11
- "prepare": "husky install",
12
- "precommit": "lint-staged",
13
- "release": "lerna publish from-package"
11
+ "prepare": "husky install"
14
12
  },
15
13
  "repository": {
16
14
  "type": "git",
17
- "url": "git+https://github.com/cuemath/ui-utils.git"
15
+ "url": "git+https://github.com/cuemath/web-utils.git"
18
16
  },
19
17
  "bugs": {
20
- "url": "https://github.com/cuemath/ui-utils/issues"
18
+ "url": "https://github.com/cuemath/web-utils/issues"
21
19
  },
22
- "homepage": "https://github.com/cuemath/ui-utils#readme",
20
+ "homepage": "https://github.com/cuemath/web-utils#readme",
23
21
  "author": "santosh k <santosh.k@cuemath.com>",
24
22
  "license": "ISC",
25
23
  "devDependencies": {
26
24
  "@cuemath/eslint-config": "1.0.9",
27
25
  "@cuemath/prettier-config": "1.0.3",
28
26
  "@cuemath/ts-config": "0.0.5",
29
- "@react-native-community/eslint-config": "^3.2.0",
27
+ "@react-native-community/eslint-config": "3.2.0",
30
28
  "@types/uuid": "9.0.0",
31
29
  "@typescript-eslint/eslint-plugin": "5.47.0",
32
30
  "@typescript-eslint/parser": "5.47.0",
33
- "eslint": "^7.32.0",
31
+ "eslint": "8.1.0",
34
32
  "eslint-config-prettier": "8.5.0",
35
33
  "eslint-plugin-import": "2.26.0",
34
+ "eslint-plugin-jest": "^27.2.1",
36
35
  "eslint-plugin-prettier": "4.2.1",
37
36
  "husky": "8.0.2",
38
- "lint-staged": ">=10",
39
- "prettier": "^2.8.1",
37
+ "prettier": "2.4.1",
40
38
  "typescript": "4.9.4"
41
39
  },
42
- "dependencies": {
43
- "@types/node": "^18.11.18",
44
- "dayjs": "^1.11.7",
45
- "lerna": "^6.4.1"
46
- },
47
- "lint-staged": {
48
- "*.{js,json,css,scss,html,md,ts}": [
49
- "prettier --write",
50
- "git add"
51
- ]
52
- }
40
+ "dependencies": {},
41
+ "side-effects": false
53
42
  }
@@ -1,4 +1,3 @@
1
- /* eslint-disable @typescript-eslint/no-explicit-any */
2
1
  export const getCookie = (name: string, cookie: string = document.cookie): string => {
3
2
  if (!cookie) {
4
3
  return '';
@@ -29,7 +28,12 @@ export function removeCookie(name: string): void {
29
28
  document.cookie = `${name}=; expires=${date.toUTCString()}; path=/`;
30
29
  }
31
30
 
32
- export function createCookie(name: string, value: string, days: number): void {
31
+ export function createCookie(
32
+ name: string,
33
+ value: string,
34
+ days: number,
35
+ subdomain: boolean,
36
+ ): void {
33
37
  let expires = '';
34
38
 
35
39
  if (days) {
@@ -38,7 +42,9 @@ export function createCookie(name: string, value: string, days: number): void {
38
42
  date.setTime(date.getTime() + days * 24 * 60 * 60 * 1000);
39
43
  expires = `; expires=${date.toUTCString()}`;
40
44
  }
41
- document.cookie = `${name}=${encodeURIComponent(value)}${expires}; path=/`;
45
+ document.cookie = `${name}=${encodeURIComponent(value)}${expires}; path=/${
46
+ subdomain ? '; .cuemath.com' : ''
47
+ }`;
42
48
  }
43
49
 
44
50
  export function createCookieWithMidnightExp(name: string, value: string): void {
@@ -48,4 +54,4 @@ export function createCookieWithMidnightExp(name: string, value: string): void {
48
54
  const expires = `; expires=${date}`;
49
55
 
50
56
  document.cookie = `${name}=${value}${expires}; path=/`;
51
- }
57
+ }
@@ -0,0 +1,191 @@
1
+ import type {
2
+ SourceDetails,
3
+ Platform,
4
+ SignupFlow,
5
+ UTMParams,
6
+ Experiments,
7
+ RevenueChannel,
8
+ UTMParamsKeys,
9
+ } from './types';
10
+
11
+ import { createCookie, getCookie } from '../cookie';
12
+
13
+ const SOURCE_DETAILS_COOKIE = 'source_details';
14
+ const UTM_PARAMS: UTMParamsKeys[] = [
15
+ 'utm_source',
16
+ 'utm_medium',
17
+ 'utm_campaign',
18
+ 'utm_term',
19
+ ];
20
+
21
+ export const readSourceCookie = (): SourceDetails => {
22
+ const sourceDetails = getCookie(SOURCE_DETAILS_COOKIE);
23
+
24
+ return sourceDetails ? JSON.parse(decodeURIComponent(sourceDetails)) : undefined;
25
+ };
26
+
27
+ const writeSourceCookie = (sourceDetails: SourceDetails): void => {
28
+ createCookie(SOURCE_DETAILS_COOKIE, JSON.stringify(sourceDetails), 365, true);
29
+ };
30
+
31
+ export const isSourcePresent = (): boolean => {
32
+ return !!getCookie(SOURCE_DETAILS_COOKIE);
33
+ };
34
+
35
+ const updateSourceCookie = (sourceDetail: Partial<SourceDetails>): void => {
36
+ if (!isSourcePresent) return;
37
+
38
+ const sourceDetails: SourceDetails = readSourceCookie();
39
+ const updatedDetails: SourceDetails = {
40
+ ...sourceDetails,
41
+ ...sourceDetail,
42
+ };
43
+
44
+ writeSourceCookie(updatedDetails);
45
+ };
46
+
47
+ const getRevenueChannel = (platform: Platform, utmParams?: UTMParams): RevenueChannel => {
48
+ let revenueChannel: RevenueChannel = 'unknown';
49
+
50
+ // set defaults for WEBSITE and ASTRO
51
+ if (platform === 'website') {
52
+ revenueChannel = 'organic';
53
+ } else if (platform === 'astro') {
54
+ revenueChannel = 'performance';
55
+ }
56
+
57
+ if (utmParams) {
58
+ const { utm_source: utmSource = '' } = utmParams;
59
+
60
+ switch (true) {
61
+ case /^affiliate-/.test(utmSource):
62
+ revenueChannel = 'affiliate';
63
+ break;
64
+ case /^offline-/.test(utmSource):
65
+ revenueChannel = 'offline';
66
+ break;
67
+ case /^referral-/.test(utmSource):
68
+ revenueChannel = 'referral';
69
+ break;
70
+ case /^performance-/.test(utmSource):
71
+ revenueChannel = 'performance';
72
+ break;
73
+ }
74
+ }
75
+
76
+ return revenueChannel;
77
+ };
78
+
79
+ /*
80
+ if Platform = website, then decide based on experiment key
81
+ if Platform = Astro, decide logic once BAU is started
82
+ if Platform = APP, decide logic
83
+ if Platform = chatbot, decide based on chatbot experiment key
84
+ */
85
+ const getFlow = (platform: Platform, experiments?: Experiments): SignupFlow => {
86
+ let flow: SignupFlow = 'regular';
87
+
88
+ if (platform === 'website') {
89
+ if (experiments) {
90
+ const ecnaExp = Object.keys(experiments).find(
91
+ experiment => experiment.indexOf('ecna') !== -1,
92
+ );
93
+
94
+ flow = ecnaExp && experiments[ecnaExp] === 'b' ? 'e-cna' : 'regular';
95
+ }
96
+ }
97
+
98
+ return flow;
99
+ };
100
+
101
+ const getUTMParams = (): UTMParams | undefined => {
102
+ if (typeof window === undefined) return;
103
+
104
+ const search = new URLSearchParams(window.location.search);
105
+ const utmParams = UTM_PARAMS.reduce((acc: UTMParams, param) => {
106
+ const utmParam = search.get(param) as string;
107
+
108
+ if (utmParam) {
109
+ acc[param] = utmParam;
110
+ }
111
+
112
+ return acc;
113
+ }, {});
114
+
115
+ return utmParams;
116
+ };
117
+
118
+ const getFirstPage = (): string => {
119
+ if (typeof window === undefined) return '';
120
+
121
+ return window.location.pathname;
122
+ };
123
+
124
+ /* TODO: Align Marketing Team on UTM source convention
125
+ affiliate-<channel>
126
+ performance-<channel>
127
+ organic-<channel>
128
+ offline-<channel>
129
+ */
130
+ const getChannel = (utmParams: UTMParams | undefined): string => {
131
+ // TODO: UTM source patter for FB, GOOGLE...
132
+ if (!utmParams) return '';
133
+
134
+ const { utm_source: utmSource = '' } = utmParams;
135
+
136
+ return utmSource.split('-')[1];
137
+ };
138
+
139
+ /*
140
+ Set Static Source Details of user on Visit of Platform
141
+ */
142
+ export const initSourceDetails = async ({
143
+ platform,
144
+ experiments,
145
+ flow,
146
+ affiliateChannel,
147
+ offlineChannel,
148
+ organicChannel,
149
+ performanceChannel,
150
+ revenueChannel,
151
+ }: SourceDetails): Promise<void> => {
152
+ if (!isSourcePresent()) {
153
+ const utmParams = getUTMParams();
154
+ const leadChannel = getChannel(utmParams);
155
+
156
+ revenueChannel = revenueChannel || getRevenueChannel(platform, utmParams);
157
+ affiliateChannel =
158
+ revenueChannel === 'affiliate' ? affiliateChannel || leadChannel : undefined;
159
+ offlineChannel =
160
+ revenueChannel === 'offline' ? offlineChannel || leadChannel : undefined;
161
+ organicChannel =
162
+ revenueChannel === 'organic' ? organicChannel || leadChannel : undefined;
163
+ performanceChannel =
164
+ revenueChannel === 'performance' ? performanceChannel || leadChannel : undefined;
165
+
166
+ const sourceDetails: SourceDetails = {
167
+ platform,
168
+ experiments,
169
+ utmParams: getUTMParams(),
170
+ flow: flow || getFlow(platform, experiments),
171
+ affiliateChannel,
172
+ offlineChannel,
173
+ organicChannel,
174
+ performanceChannel,
175
+ revenueChannel: revenueChannel,
176
+ firstPage: getFirstPage(),
177
+ };
178
+
179
+ writeSourceCookie(sourceDetails);
180
+ }
181
+ };
182
+
183
+ // Last Page which user visited signup before
184
+ export const setLastPage = async (pagePath: string): Promise<void> => {
185
+ updateSourceCookie({ lastPage: pagePath });
186
+ };
187
+
188
+ // set Entry point where user clicked to Signup
189
+ export const setFlowEntryPoint = async (flowEntry: string): Promise<void> => {
190
+ updateSourceCookie({ flowEntry });
191
+ };
@@ -0,0 +1,33 @@
1
+ export type Platform = 'website' | 'app' | 'astro' | 'leap-teacher' | 'leap-admin';
2
+ export type RevenueChannel =
3
+ | 'organic'
4
+ | 'performance'
5
+ | 'affiliate'
6
+ | 'offline'
7
+ | 'referral'
8
+ | 'unknown';
9
+ export type SignupFlow = 'regular' | 'e-cna' | 'e-sales';
10
+ export type Experiments = Record<string, unknown>;
11
+ export type UTMParams = {
12
+ utm_source?: string;
13
+ utm_medium?: string;
14
+ utm_campaign?: string;
15
+ utm_term?: string;
16
+ };
17
+
18
+ export type UTMParamsKeys = keyof UTMParams;
19
+
20
+ export type SourceDetails = {
21
+ platform: Platform;
22
+ experiments?: Experiments;
23
+ flow?: SignupFlow;
24
+ utmParams?: UTMParams;
25
+ affiliateChannel?: string;
26
+ offlineChannel?: string;
27
+ performanceChannel?: string;
28
+ revenueChannel: RevenueChannel;
29
+ organicChannel?: string;
30
+ flowEntry?: string;
31
+ firstPage?: string;
32
+ lastPage?: string;
33
+ };
package/src/index.ts CHANGED
@@ -1,7 +1,2 @@
1
1
  export * from './cookie';
2
- export * from './constants';
3
- export * from './local-storage';
4
- export * from './e-cna';
5
- export * from './date-time-helper';
6
- export * from './country';
7
- export * from './object';
2
+ export * from './growth-source';
package/.eslintignore DELETED
@@ -1,2 +0,0 @@
1
- .next
2
- /dist
package/.huskyrc DELETED
@@ -1,5 +0,0 @@
1
- {
2
- "hooks": {
3
- "pre-commit": "lint-staged"
4
- }
5
- }
package/.lintstagedrc.yml DELETED
@@ -1,5 +0,0 @@
1
- linters:
2
- ./**/*.ts:
3
- - prettier --write
4
- - eslint
5
- - git add
@@ -1,2 +0,0 @@
1
- export { COUNTRY_NAME_COUNTRY_CODE_MAP as ISO_COUNTRY_CODE } from './iso-country-code';
2
- export const CUE_COUNTRY_CODE_KEY = 'cue_country_code';
@@ -1,248 +0,0 @@
1
- export const COUNTRY_NAME_COUNTRY_CODE_MAP = {
2
- 'AFGHANISTAN': 'AF',
3
- 'ALAND ISLANDS': 'AX',
4
- 'ALBANIA': 'AL',
5
- 'ALGERIA': 'DZ',
6
- 'AMERICAN SAMOA': 'AS',
7
- 'ANDORRA': 'AD',
8
- 'ANGOLA': 'AO',
9
- 'ANGUILLA': 'AI',
10
- 'ANTARCTICA': 'AQ',
11
- 'ANTIGUA AND BARBUDA': 'AG',
12
- 'ARGENTINA': 'AR',
13
- 'ARMENIA': 'AM',
14
- 'ARUBA': 'AW',
15
- 'AUSTRALIA': 'AU',
16
- 'AUSTRIA': 'AT',
17
- 'AZERBAIJAN': 'AZ',
18
- 'BAHAMAS': 'BS',
19
- 'BAHRAIN': 'BH',
20
- 'BANGLADESH': 'BD',
21
- 'BARBADOS': 'BB',
22
- 'BELARUS': 'BY',
23
- 'BELGIUM': 'BE',
24
- 'BELIZE': 'BZ',
25
- 'BENIN': 'BJ',
26
- 'BERMUDA': 'BM',
27
- 'BHUTAN': 'BT',
28
- 'BOLIVIA': 'BO',
29
- 'BOSNIA AND HERZEGOVINA': 'BA',
30
- 'BOTSWANA': 'BW',
31
- 'BOUVET ISLAND': 'BV',
32
- 'BRAZIL': 'BR',
33
- 'BRITISH INDIAN OCEAN TERRITORY': 'IO',
34
- 'BRUNEI DARUSSALAM': 'BN',
35
- 'BULGARIA': 'BG',
36
- 'BURKINA FASO': 'BF',
37
- 'BURUNDI': 'BI',
38
- 'CAMBODIA': 'KH',
39
- 'CAMEROON': 'CM',
40
- 'CANADA': 'CA',
41
- 'CAPE VERDE': 'CV',
42
- 'CAYMAN ISLANDS': 'KY',
43
- 'CENTRAL AFRICAN REPUBLIC': 'CF',
44
- 'CHAD': 'TD',
45
- 'CHILE': 'CL',
46
- 'CHINA': 'CN',
47
- 'CHRISTMAS ISLAND': 'CX',
48
- 'COCOS (KEELING) ISLANDS': 'CC',
49
- 'COLOMBIA': 'CO',
50
- 'COMOROS': 'KM',
51
- 'CONGO': 'CG',
52
- 'CONGO, DEMOCRATIC REPUBLIC': 'CD',
53
- 'COOK ISLANDS': 'CK',
54
- 'COSTA RICA': 'CR',
55
- 'COTE D"IVOIRE': 'CI',
56
- 'CROATIA': 'HR',
57
- 'CUBA': 'CU',
58
- 'CYPRUS': 'CY',
59
- 'CZECH REPUBLIC': 'CZ',
60
- 'DENMARK': 'DK',
61
- 'DJIBOUTI': 'DJ',
62
- 'DOMINICA': 'DM',
63
- 'DOMINICAN REPUBLIC': 'DO',
64
- 'ECUADOR': 'EC',
65
- 'EGYPT': 'EG',
66
- 'EL SALVADOR': 'SV',
67
- 'EQUATORIAL GUINEA': 'GQ',
68
- 'ERITREA': 'ER',
69
- 'ESTONIA': 'EE',
70
- 'ETHIOPIA': 'ET',
71
- 'FALKLAND ISLANDS (MALVINAS)': 'FK',
72
- 'FAROE ISLANDS': 'FO',
73
- 'FIJI': 'FJ',
74
- 'FINLAND': 'FI',
75
- 'FRANCE': 'FR',
76
- 'FRENCH GUIANA': 'GF',
77
- 'FRENCH POLYNESIA': 'PF',
78
- 'FRENCH SOUTHERN TERRITORIES': 'TF',
79
- 'GABON': 'GA',
80
- 'GAMBIA': 'GM',
81
- 'GEORGIA': 'GE',
82
- 'GERMANY': 'DE',
83
- 'GHANA': 'GH',
84
- 'GIBRALTAR': 'GI',
85
- 'GREECE': 'GR',
86
- 'GREENLAND': 'GL',
87
- 'GRENADA': 'GD',
88
- 'GUADELOUPE': 'GP',
89
- 'GUAM': 'GU',
90
- 'GUATEMALA': 'GT',
91
- 'GUERNSEY': 'GG',
92
- 'GUINEA': 'GN',
93
- 'GUINEA-BISSAU': 'GW',
94
- 'GUYANA': 'GY',
95
- 'HAITI': 'HT',
96
- 'HEARD ISLAND & MCDONALD ISLANDS': 'HM',
97
- 'HOLY SEE (VATICAN CITY STATE)': 'VA',
98
- 'HONDURAS': 'HN',
99
- 'HONG KONG': 'HK',
100
- 'HUNGARY': 'HU',
101
- 'ICELAND': 'IS',
102
- 'INDIA': 'IN',
103
- 'INDONESIA': 'ID',
104
- 'IRAN, ISLAMIC REPUBLIC OF': 'IR',
105
- 'IRAQ': 'IQ',
106
- 'IRELAND': 'IE',
107
- 'ISLE OF MAN': 'IM',
108
- 'ISRAEL': 'IL',
109
- 'ITALY': 'IT',
110
- 'JAMAICA': 'JM',
111
- 'JAPAN': 'JP',
112
- 'JERSEY': 'JE',
113
- 'JORDAN': 'JO',
114
- 'KAZAKHSTAN': 'KZ',
115
- 'KENYA': 'KE',
116
- 'KIRIBATI': 'KI',
117
- 'KOREA': 'KR',
118
- 'NORTH KOREA': 'KP',
119
- 'KUWAIT': 'KW',
120
- 'KYRGYZSTAN': 'KG',
121
- 'LAO PEOPLE"S DEMOCRATIC REPUBLIC': 'LA',
122
- 'LATVIA': 'LV',
123
- 'LEBANON': 'LB',
124
- 'LESOTHO': 'LS',
125
- 'LIBERIA': 'LR',
126
- 'LIBYAN ARAB JAMAHIRIYA': 'LY',
127
- 'LIECHTENSTEIN': 'LI',
128
- 'LITHUANIA': 'LT',
129
- 'LUXEMBOURG': 'LU',
130
- 'MACAO': 'MO',
131
- 'MACEDONIA': 'MK',
132
- 'MADAGASCAR': 'MG',
133
- 'MALAWI': 'MW',
134
- 'MALAYSIA': 'MY',
135
- 'MALDIVES': 'MV',
136
- 'MALI': 'ML',
137
- 'MALTA': 'MT',
138
- 'MARSHALL ISLANDS': 'MH',
139
- 'MARTINIQUE': 'MQ',
140
- 'MAURITANIA': 'MR',
141
- 'MAURITIUS': 'MU',
142
- 'MAYOTTE': 'YT',
143
- 'MEXICO': 'MX',
144
- 'MICRONESIA, FEDERATED STATES OF': 'FM',
145
- 'MOLDOVA': 'MD',
146
- 'MONACO': 'MC',
147
- 'MONGOLIA': 'MN',
148
- 'MONTENEGRO': 'ME',
149
- 'MONTSERRAT': 'MS',
150
- 'MOROCCO': 'MA',
151
- 'MOZAMBIQUE': 'MZ',
152
- 'MYANMAR': 'MM',
153
- 'NAMIBIA': 'NA',
154
- 'NAURU': 'NR',
155
- 'NEPAL': 'NP',
156
- 'NETHERLANDS': 'NL',
157
- 'NETHERLANDS ANTILLES': 'AN',
158
- 'NEW CALEDONIA': 'NC',
159
- 'NEW ZEALAND': 'NZ',
160
- 'NICARAGUA': 'NI',
161
- 'NIGER': 'NE',
162
- 'NIGERIA': 'NG',
163
- 'NIUE': 'NU',
164
- 'NORFOLK ISLAND': 'NF',
165
- 'NORTHERN MARIANA ISLANDS': 'MP',
166
- 'NORWAY': 'NO',
167
- 'OMAN': 'OM',
168
- 'PAKISTAN': 'PK',
169
- 'PALAU': 'PW',
170
- 'PALESTINIAN TERRITORY, OCCUPIED': 'PS',
171
- 'PANAMA': 'PA',
172
- 'PAPUA NEW GUINEA': 'PG',
173
- 'PARAGUAY': 'PY',
174
- 'PERU': 'PE',
175
- 'PHILIPPINES': 'PH',
176
- 'PITCAIRN': 'PN',
177
- 'POLAND': 'PL',
178
- 'PORTUGAL': 'PT',
179
- 'PUERTO RICO': 'PR',
180
- 'QATAR': 'QA',
181
- 'REUNION': 'RE',
182
- 'ROMANIA': 'RO',
183
- 'RUSSIAN FEDERATION': 'RU',
184
- 'RWANDA': 'RW',
185
- 'SAINT BARTHELEMY': 'BL',
186
- 'SAINT HELENA': 'SH',
187
- 'SAINT KITTS AND NEVIS': 'KN',
188
- 'SAINT LUCIA': 'LC',
189
- 'SAINT MARTIN': 'MF',
190
- 'SAINT PIERRE AND MIQUELON': 'PM',
191
- 'SAINT VINCENT AND GRENADINES': 'VC',
192
- 'SAMOA': 'WS',
193
- 'SAN MARINO': 'SM',
194
- 'SAO TOME AND PRINCIPE': 'ST',
195
- 'SAUDI ARABIA': 'SA',
196
- 'SENEGAL': 'SN',
197
- 'SERBIA': 'RS',
198
- 'SEYCHELLES': 'SC',
199
- 'SIERRA LEONE': 'SL',
200
- 'SINGAPORE': 'SG',
201
- 'SLOVAKIA': 'SK',
202
- 'SLOVENIA': 'SI',
203
- 'SOLOMON ISLANDS': 'SB',
204
- 'SOMALIA': 'SO',
205
- 'SOUTH AFRICA': 'ZA',
206
- 'SOUTH GEORGIA AND SANDWICH ISL.': 'GS',
207
- 'SPAIN': 'ES',
208
- 'SRI LANKA': 'LK',
209
- 'SUDAN': 'SD',
210
- 'SURINAME': 'SR',
211
- 'SVALBARD AND JAN MAYEN': 'SJ',
212
- 'SWAZILAND': 'SZ',
213
- 'SWEDEN': 'SE',
214
- 'SWITZERLAND': 'CH',
215
- 'SYRIAN ARAB REPUBLIC': 'SY',
216
- 'TAIWAN': 'TW',
217
- 'TAJIKISTAN': 'TJ',
218
- 'TANZANIA': 'TZ',
219
- 'THAILAND': 'TH',
220
- 'TIMOR-LESTE': 'TL',
221
- 'TOGO': 'TG',
222
- 'TOKELAU': 'TK',
223
- 'TONGA': 'TO',
224
- 'TRINIDAD AND TOBAGO': 'TT',
225
- 'TUNISIA': 'TN',
226
- 'TURKEY': 'TR',
227
- 'TURKMENISTAN': 'TM',
228
- 'TURKS AND CAICOS ISLANDS': 'TC',
229
- 'TUVALU': 'TV',
230
- 'UGANDA': 'UG',
231
- 'UKRAINE': 'UA',
232
- 'UNITED ARAB EMIRATES': 'AE',
233
- 'UNITED KINGDOM': 'GB',
234
- 'UNITED STATES': 'US',
235
- 'UNITED STATES OUTLYING ISLANDS': 'UM',
236
- 'URUGUAY': 'UY',
237
- 'UZBEKISTAN': 'UZ',
238
- 'VANUATU': 'VU',
239
- 'VENEZUELA': 'VE',
240
- 'VIETNAM': 'VN',
241
- 'VIRGIN ISLANDS, BRITISH': 'VG',
242
- 'VIRGIN ISLANDS, U.S.': 'VI',
243
- 'WALLIS AND FUTUNA': 'WF',
244
- 'WESTERN SAHARA': 'EH',
245
- 'YEMEN': 'YE',
246
- 'ZAMBIA': 'ZM',
247
- 'ZIMBABWE': 'ZW',
248
- };
@@ -1,43 +0,0 @@
1
- export const DAY = {
2
- Sun: 'Sunday',
3
- Mon: 'Monday',
4
- Tue: 'Tuesday',
5
- Wed: 'Wednesday',
6
- Thu: 'Thursday',
7
- Fri: 'Friday',
8
- Sat: 'Saturday',
9
- };
10
-
11
- export const shorthandWeekDayArray = ['Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa', 'Su'];
12
-
13
- export const monthArray = [
14
- 'Jan',
15
- 'Feb',
16
- 'Mar',
17
- 'Apr',
18
- 'May',
19
- 'Jun',
20
- 'Jul',
21
- 'Aug',
22
- 'Sept',
23
- 'Oct',
24
- 'Nov',
25
- 'Dec',
26
- ];
27
-
28
- export const weekDayArray: string[] = [
29
- 'Sunday',
30
- 'Monday',
31
- 'Tuesday',
32
- 'Wednesday',
33
- 'Thursday',
34
- 'Friday',
35
- 'Saturday',
36
- ];
37
-
38
- export const TWENTY_FOUR_HOURS_IN_SECONDS: number = 24 * 60 * 60; // 86400
39
-
40
- export const HOUR_FORMAT = {
41
- TWELVE_HOUR_FORMAT: 12,
42
- TWENTY_FOUR_HOUR_FORMAT: 24,
43
- };