|
21 | 21 | handling of some edge cases. Additionally included in the low-level API are |
22 | 22 | `calendar_spanning_seq()`, `time_point_spanning_seq()`, and |
23 | 23 | `duration_spanning_seq()` (#279). |
24 | | - |
| 24 | + |
25 | 25 | * New `date_time_info()` and `zoned_time_info()` low-level helpers for accessing |
26 | 26 | the previous/next transition times, the offset from UTC, and the current time |
27 | 27 | zone abbreviation (#295). |
28 | | - |
| 28 | + |
29 | 29 | * `calendar_leap_year()` now supports the year-quarter-day and iso-year-week-day |
30 | 30 | calendars (#332, #333). |
31 | 31 |
|
|
36 | 36 | allowed by the underlying C++ types. This means that if you have serialized |
37 | 37 | a value of one of these types with an old version of clock, then it will no |
38 | 38 | longer unserialize correctly going forward. |
39 | | - |
| 39 | + |
40 | 40 | Technically, rather than storing a variable number of integer vectors |
41 | 41 | representing ticks, ticks of a day, and ticks of a second, we now always store |
42 | 42 | values of these types within two double vectors, regardless of the precision. |
|
55 | 55 |
|
56 | 56 | * `%%` and `%/%` operators now return a missing value when the right-hand side |
57 | 57 | is `0`. For `%/%`, this is consistent with `2L %/% 0L`, which returns a |
58 | | - missing value, rather than with `2 %/% 0`, which returns `Inf`, since |
| 58 | + missing value, rather than with `2 %/% 0`, which returns `Inf`, since |
59 | 59 | infinite durations are not supported (#349). |
60 | 60 |
|
61 | 61 | * `seq()` methods for durations and time points handle the empty sequence cases |
|
71 | 71 |
|
72 | 72 | * Duration vectors now work as `.before` and `.after` arguments of |
73 | 73 | `slider::slide_index()` and friends (#306). |
74 | | - |
| 74 | + |
75 | 75 | * All `as_*()` generics exported by clock now include `...` in their signature |
76 | 76 | to help with extensibility of converting to clock types. These are the only |
77 | 77 | clock generics that are currently "blessed" as fully extensible (#348). |
78 | | - |
| 78 | + |
79 | 79 | * `as.character()` has been implemented for durations. |
80 | 80 |
|
81 | 81 | * Fixed `vec_ptype_full()` and `vec_ptype_abbr()` methods for sys-time and |
82 | 82 | naive-time objects (#302). |
83 | | - |
| 83 | + |
84 | 84 | * Many errors have been improved (#219, #286, #595). |
85 | | - |
| 85 | + |
86 | 86 | * Renamed `locale.h` to `fill.h` to avoid clock's `locale.h` being chosen over a |
87 | 87 | system header of the same name on some CentOS machines (#310). |
88 | | - |
| 88 | + |
89 | 89 | * Skipped a test on 32-bit architectures to work around a bug in base R (#312). |
90 | 90 |
|
91 | 91 | * R >=3.5.0 is now required, which is in line with tidyverse standards. |
|
129 | 129 | number of uses, like computing the age of an individual in years, or |
130 | 130 | determining the number of weeks that have passed since the start of the year |
131 | 131 | (#266). |
132 | | - |
| 132 | + |
133 | 133 | * Modulus is now defined between a duration vector and an integer vector |
134 | 134 | through `<duration> %% <integer>`. This returns a duration vector containing |
135 | 135 | the remainder of the division (#273). |
|
155 | 155 | * To align more with RFC 3339 and ISO 8601 standards, the default formats used |
156 | 156 | in many of the date formatting and parsing functions have been slightly |
157 | 157 | altered. The following changes have been made: |
158 | | - |
| 158 | + |
159 | 159 | * Date-times (POSIXct): |
160 | | - |
| 160 | + |
161 | 161 | * `date_format()` now prints a `T` between the date and time. |
162 | | - |
| 162 | + |
163 | 163 | * `date_time_parse_complete()` now expects a `T` between the date and time |
164 | 164 | by default. |
165 | | - |
| 165 | + |
166 | 166 | * Sys-times: |
167 | | - |
| 167 | + |
168 | 168 | * `format()` and `as.character()` now print a `T` between the date and time. |
169 | | - |
| 169 | + |
170 | 170 | * `sys_time_parse()` now expects a `T` between the date and time by default. |
171 | | - |
| 171 | + |
172 | 172 | * Naive-times: |
173 | | - |
| 173 | + |
174 | 174 | * `format()` and `as.character()` now print a `T` between the date and time. |
175 | | - |
| 175 | + |
176 | 176 | * `naive_time_parse()` now expects a `T` between the date and time by |
177 | 177 | default. |
178 | | - |
| 178 | + |
179 | 179 | * Zoned-times: |
180 | | - |
| 180 | + |
181 | 181 | * `format()` and `as.character()` now print a `T` between the date and time. |
182 | | - |
| 182 | + |
183 | 183 | * `zoned_time_parse_complete()` now expects a `T` between the date and time |
184 | 184 | by default. |
185 | | - |
| 185 | + |
186 | 186 | * Calendars: |
187 | | - |
| 187 | + |
188 | 188 | * `format()` and `as.character()` now print a `T` between the date and time. |
189 | | - |
| 189 | + |
190 | 190 | * `year_month_day_parse()` now expects a `T` between the date and time by |
191 | 191 | default. |
192 | 192 |
|
193 | 193 | * Further improved documentation of undefined behavior resulting from attempting |
194 | 194 | to parse sub-daily components of a string that is intended to be parsed into |
195 | 195 | a Date (#258). |
196 | | - |
| 196 | + |
197 | 197 | * Bumped required minimum version of tzdb to 0.2.0 to get access to the latest |
198 | 198 | time zone database information (2021e) and to fix a Unicode bug on Windows. |
199 | 199 |
|
|
211 | 211 |
|
212 | 212 | * New `invalid_remove()` for removing invalid dates. This is just a wrapper |
213 | 213 | around `x[!invalid_detect(x)]`, but works nicely with the pipe (#229). |
214 | | - |
| 214 | + |
215 | 215 | * All clock types now support `is.nan()`, `is.finite()`, and `is.infinite()`. |
216 | 216 | Additionally, duration types now support `abs()` and `sign()` (#235). |
217 | 217 |
|
|
228 | 228 | full string, with fractional seconds, into a clock type that can handle them, |
229 | 229 | then round to seconds using whatever rounding convention is required for your |
230 | 230 | use case, such as `time_point_floor()` (#230). |
231 | | - |
| 231 | + |
232 | 232 | For example: |
233 | | - |
| 233 | + |
234 | 234 | ``` |
235 | 235 | x <- c("2019-01-01 00:00:59.123", "2019-01-01 00:00:59.556") |
236 | | - |
| 236 | +
|
237 | 237 | x <- naive_time_parse(x, precision = "millisecond") |
238 | 238 | x |
239 | 239 | #> <time_point<naive><millisecond>[2]> |
240 | 240 | #> [1] "2019-01-01 00:00:59.123" "2019-01-01 00:00:59.556" |
241 | | - |
| 241 | +
|
242 | 242 | x <- time_point_round(x, "second") |
243 | 243 | x |
244 | 244 | #> <time_point<naive><second>[2]> |
245 | 245 | #> [1] "2019-01-01 00:00:59" "2019-01-01 00:01:00" |
246 | | - |
| 246 | +
|
247 | 247 | as_date_time(x, "America/New_York") |
248 | 248 | #> [1] "2019-01-01 00:00:59 EST" "2019-01-01 00:01:00 EST" |
249 | 249 | ``` |
250 | | - |
| 250 | + |
251 | 251 | * Preemptively updated tests related to upcoming changes in testthat (#236). |
252 | 252 |
|
253 | 253 | # clock 0.3.0 |
|
257 | 257 | * clock now uses the tzdb package to access the date library's API. This |
258 | 258 | means that the experimental API that was to be used for vroom has been |
259 | 259 | removed in favor of using the one exposed in tzdb. |
260 | | - |
| 260 | + |
261 | 261 | * `zone_database_names()` and `zone_database_version()` have been removed in |
262 | 262 | favor of re-exporting `tzdb_names()` and `tzdb_version()` from the tzdb |
263 | 263 | package. |
|
268 | 268 | This means that it no longer assumes that Date has an implied time zone of |
269 | 269 | UTC (#203). This generally aligns better with how users think Date should |
270 | 270 | work. This resulted in the following changes: |
271 | | - |
| 271 | + |
272 | 272 | * `date_zone()` now errors with Date input, as naive-times do not have a |
273 | 273 | specified time zone. |
274 | | - |
| 274 | + |
275 | 275 | * `date_parse()` now parses into a naive-time, rather than a sys-time, before |
276 | 276 | converting to Date. This means that `%z` and `%Z` are now completely |
277 | 277 | ignored. |
278 | | - |
| 278 | + |
279 | 279 | * The Date method for `date_format()` now uses the naive-time `format()` |
280 | 280 | method rather than the zoned-time one. This means that `%z` and `%Z` are |
281 | 281 | no longer valid format commands. |
282 | | - |
| 282 | + |
283 | 283 | * The zoned-time method for `as.Date()` now converts to Date through an |
284 | 284 | intermediate naive-time, rather than a sys-time. This means that the |
285 | 285 | printed date will always be retained, which is generally what is expected. |
286 | | - |
| 286 | + |
287 | 287 | * The Date method for `as_zoned_time()` now converts to zoned-time through |
288 | 288 | an intermediate naive-time, rather than a sys-time. This means that the |
289 | 289 | printed date will always attempt to be retained, if possible, which is |
|
301 | 301 | * Added two new convenient helpers (#197): |
302 | 302 |
|
303 | 303 | * `date_today()` for getting the current date (Date) |
304 | | - |
| 304 | + |
305 | 305 | * `date_now()` for getting the current date-time (POSIXct) |
306 | 306 |
|
307 | 307 | * Fixed a bug where converting from a time point to a Date or POSIXct could |
308 | 308 | round incorrectly (#205). |
309 | 309 |
|
310 | 310 | * Errors resulting from invalid dates or nonexistent/ambiguous times are now |
311 | 311 | a little nicer to read through the usage of an info bullet (#200). |
312 | | - |
| 312 | + |
313 | 313 | * Formatting a naive-time with `%Z` or `%z` now warns that there were |
314 | 314 | format failures (#204). |
315 | 315 |
|
|
0 commit comments