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
Copy file name to clipboardExpand all lines: packages/date/README.md
+18-18Lines changed: 18 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -28,8 +28,8 @@ _Related_
28
28
_Parameters_
29
29
30
30
-_dateFormat_`string`: PHP-style formatting string. See [php.net/date](https://www.php.net/manual/en/function.date.php).
31
-
-_dateValue_`Moment | Date | string | undefined`: Date object or string, parsable by moment.js.
32
-
-_timezone_`string | number | undefined`: Timezone to output result in or a UTC offset. Defaults to timezone from site.
31
+
-_dateValue_`Moment | Date | string | number`: Date object or string, parsable by moment.js.
32
+
-_timezone_`string`: Timezone to output result in or a UTC offset. Defaults to timezone from site.
33
33
34
34
_Returns_
35
35
@@ -49,12 +49,12 @@ _Related_
49
49
_Parameters_
50
50
51
51
-_dateFormat_`string`: PHP-style formatting string. See [php.net/date](https://www.php.net/manual/en/function.date.php).
52
-
-_dateValue_`Moment | Date | string | undefined`: Date object or string, parsable by moment.js.
53
-
-_timezone_`string | number | boolean | undefined=`: Timezone to output result in or a UTC offset. Defaults to timezone from site. Notice: `boolean` is effectively deprecated, but still supported for backward compatibility reasons.
52
+
-_dateValue_`Moment | Date | string | number`: Date object or string, parsable by moment.js.
53
+
-_timezone_`string | number | boolean`: Timezone to output result in or a UTC offset. Defaults to timezone from site. Notice: `boolean` is effectively deprecated, but still supported for backward compatibility reasons.
54
54
55
55
_Returns_
56
56
57
-
-`string`: Formatted date.
57
+
- Formatted date.
58
58
59
59
### format
60
60
@@ -63,23 +63,23 @@ Formats a date. Does not alter the date's timezone.
63
63
_Parameters_
64
64
65
65
-_dateFormat_`string`: PHP-style formatting string. See [php.net/date](https://www.php.net/manual/en/function.date.php).
66
-
-_dateValue_`Moment | Date | string | undefined`: Date object or string, parsable by moment.js.
66
+
-_dateValue_`Moment | Date | string | number`: Date object or string, parsable by moment.js.
67
67
68
68
_Returns_
69
69
70
-
-`string`: Formatted date.
70
+
- Formatted date.
71
71
72
72
### getDate
73
73
74
74
Create and return a JavaScript Date Object from a date string in the WP timezone.
75
75
76
76
_Parameters_
77
77
78
-
-_dateString_`?string`: Date formatted in the WP timezone.
78
+
-_dateString_`string | null`: Date formatted in the WP timezone.
79
79
80
80
_Returns_
81
81
82
-
-`Date`: Date
82
+
- Date
83
83
84
84
### getSettings
85
85
@@ -96,11 +96,11 @@ Formats a date (like `date()` in PHP), in the UTC timezone.
96
96
_Parameters_
97
97
98
98
-_dateFormat_`string`: PHP-style formatting string. See [php.net/date](https://www.php.net/manual/en/function.date.php).
99
-
-_dateValue_`Moment | Date | string | undefined`: Date object or string, parsable by moment.js.
99
+
-_dateValue_`Moment | Date | string | number`: Date object or string, parsable by moment.js.
100
100
101
101
_Returns_
102
102
103
-
-`string`: Formatted date in English.
103
+
- Formatted date in English.
104
104
105
105
### gmdateI18n
106
106
@@ -109,36 +109,36 @@ Formats a date (like `wp_date()` in PHP), translating it into site's locale and
109
109
_Parameters_
110
110
111
111
-_dateFormat_`string`: PHP-style formatting string. See [php.net/date](https://www.php.net/manual/en/function.date.php).
112
-
-_dateValue_`Moment | Date | string | undefined`: Date object or string, parsable by moment.js.
112
+
-_dateValue_`Moment | Date | string | number`: Date object or string, parsable by moment.js.
113
113
114
114
_Returns_
115
115
116
-
-`string`: Formatted date.
116
+
- Formatted date.
117
117
118
118
### humanTimeDiff
119
119
120
120
Returns a human-readable time difference between two dates, like human_time_diff() in PHP.
121
121
122
122
_Parameters_
123
123
124
-
-_from_`Moment | Date | string`: From date, in the WP timezone.
125
-
-_to_`Moment | Date | string | undefined`: To date, formatted in the WP timezone.
124
+
-_from_`Moment | Date | string | number`: From date, in the WP timezone.
125
+
-_to_`Moment | Date | string | number`: To date, formatted in the WP timezone.
126
126
127
127
_Returns_
128
128
129
-
-`string`: Human-readable time difference.
129
+
- Human-readable time difference.
130
130
131
131
### isInTheFuture
132
132
133
133
Check whether a date is considered in the future according to the WordPress settings.
134
134
135
135
_Parameters_
136
136
137
-
-_dateValue_`string`: Date String or Date object in the Defined WP Timezone.
137
+
-_dateValue_`Date | string | number`: Date String or Date object in the Defined WP Timezone.
0 commit comments