You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on May 29, 2019. It is now read-only.
Copy file name to clipboardExpand all lines: src/dateparser/docs/README.md
+22-22
Original file line number
Diff line number
Diff line change
@@ -15,41 +15,41 @@ Certain format codes support i18n. Check this [guide](https://docs.angularjs.org
15
15
*`format`
16
16
_(Type: `string`, Example: `yyyy/MMM/d`)_ -
17
17
The format we want to use. Check all the supported formats below.
18
-
18
+
19
19
*`baseDate`
20
20
_(Type: `Date`, Example: `new Date()`)_ -
21
21
If you want to parse a date but maintain the timezone, you can pass an existing date here.
22
22
23
23
##### return
24
24
25
25
* If the specified input matches the format, a new date with the input will be returned, otherwise, it will return undefined.
26
-
26
+
27
27
### uibDateParser's format codes
28
28
29
29
*`yyyy`
30
30
_(Example: `2015`)_ -
31
31
Parses a 4 digits year.
32
-
32
+
33
33
*`yy`
34
34
_(Example: `15`)_ -
35
35
Parses a 2 digits year.
36
-
36
+
37
37
*`y`
38
38
_(Example: `15`)_ -
39
39
Parses a year with 1, 2, 3, or 4 digits.
40
-
40
+
41
41
*`MMMM`
42
42
_(Example: `February`, i18n support)_ -
43
43
Parses the full name of a month.
44
-
44
+
45
45
*`MMM`
46
46
_(Example: `Feb`, i18n support)_ -
47
47
Parses the short name of a month.
48
-
48
+
49
49
*`MM`
50
50
_(Example: `12`, Leading 0)_ -
51
51
Parses a numeric month.
52
-
52
+
53
53
*`M`
54
54
_(Example: `3`)_ -
55
55
Parses a numeric month.
@@ -61,59 +61,59 @@ Certain format codes support i18n. Check this [guide](https://docs.angularjs.org
61
61
*`dd`
62
62
_(Example: `05`, Leading 0)_ -
63
63
Parses a numeric day.
64
-
64
+
65
65
*`d`
66
66
_(Example: `5`)_ -
67
67
Parses a numeric day.
68
68
69
69
*`d!`
70
70
_(Example: `3` or `03`)_ -
71
71
Parses a numeric day, but allowing an optional leading zero
72
-
72
+
73
73
*`EEEE`
74
74
_(Example: `Sunday`, i18n support)_ -
75
75
Parses the full name of a day.
76
-
76
+
77
77
*`EEE`
78
78
_(Example: `Mon`, i18n support)_ -
79
79
Parses the short name of a day.
80
80
81
81
*`HH`
82
82
_(Example: `14`, Leading 0)_ -
83
83
Parses a 24 hours time.
84
-
84
+
85
85
*`H`
86
86
_(Example: `3`)_ -
87
87
Parses a 24 hours time.
88
-
88
+
89
89
*`hh`
90
90
_(Example: `11`, Leading 0)_ -
91
91
Parses a 12 hours time.
92
-
92
+
93
93
*`h`
94
94
_(Example: `3`)_ -
95
95
Parses a 12 hours time.
96
-
96
+
97
97
*`mm`
98
98
_(Example: `09`, Leading 0)_ -
99
99
Parses the minutes.
100
-
100
+
101
101
*`m`
102
102
_(Example: `3`)_ -
103
103
Parses the minutes.
104
-
104
+
105
105
*`sss`
106
106
_(Example: `094`, Leading 0)_ -
107
107
Parses the milliseconds.
108
-
108
+
109
109
*`ss`
110
110
_(Example: `08`, Leading 0)_ -
111
111
Parses the seconds.
112
-
112
+
113
113
*`s`
114
114
_(Example: `22`)_ -
115
115
Parses the seconds.
116
-
116
+
117
117
*`a`
118
118
_(Example: `10AM`)_ -
119
119
Parses a 12 hours time with AM/PM.
@@ -136,9 +136,9 @@ Certain format codes support i18n. Check this [guide](https://docs.angularjs.org
136
136
*`GGGG`
137
137
_(Example: `Anno Domini`)_ -
138
138
Parses the long form of the era (`Anno Domini` or `Before Christ`)
139
-
139
+
140
140
\* The ones marked with `Leading 0`, needs a leading 0 for values less than 10. Exception being milliseconds which needs it for values under 100.
141
141
142
142
\** It also supports `fullDate|longDate|medium|mediumDate|mediumTime|short|shortDate|shortTime` as the format for parsing.
143
143
144
-
\*** It supports template literals as a string between the backtick `\`` character, i.e. `\`The Date is\` MM/DD/YYYY`. If one wants the literal backtick character, one must use `\`\`\`\``.
144
+
\*** It supports template literals as a string between the single quote `'` character, i.e. `\`The Date is\` MM/DD/YYYY`. If one wants the literal single quote character, one must use `''''`.
0 commit comments