summaryrefslogtreecommitdiff
path: root/test/lisp/calendar/time-date-tests.el
Commit message (Collapse)AuthorAgeFilesLines
* ; Add 2024 to copyright yearsPo Lu2024-01-021-1/+1
|
* ; Add 2023 to copyright years.Eli Zaretskii2023-01-011-1/+1
|
* Make list-times not include zero elementsLars Ingebrigtsen2022-04-131-2/+7
| | | | | | | | | * doc/lispref/os.texi (Time Parsing): Mention %x. * lisp/calendar/time-date.el (format-seconds): Accept a new %x spec that removes trailing zeros (bug#54904). * lisp/emacs-lisp/timer-list.el (list-timers): Don't display trailing zero bits.
* Merge from origin/emacs-28Eli Zaretskii2022-01-011-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 836be7a112 ; * etc/refcards/ru-refcard.tex: Update Copyright year. 86cbc6ee4a * lisp/net/tramp-sh.el: Adapt copyright year ebe8772f65 ; Minor fixes related to copyright years 23c1ee6989 ; * test/manual/etags/ETAGS.good_N: Adjust to copyright ye... 8d3fc7ec89 * src/xfaces.c (face_for_font): Make 'hash' be uintptr_t. 19dcb237b5 ; Add 2022 to copyright years. # Conflicts: # etc/NEWS # etc/refcards/ru-refcard.tex # lib/cdefs.h # lisp/erc/erc-dcc.el # lisp/erc/erc-imenu.el # lisp/erc/erc-replace.el # lisp/image-dired.el # lisp/progmodes/xref.el # m4/alloca.m4 # m4/byteswap.m4 # m4/errno_h.m4 # m4/getopt.m4 # m4/gnulib-common.m4 # m4/inttypes.m4 # m4/stddef_h.m4 # m4/stdint.m4 # m4/sys_socket_h.m4
| * ; Add 2022 to copyright years.Eli Zaretskii2022-01-011-1/+1
| |
* | Use time-equal-p to compare timestamps in testsPaul Eggert2021-12-051-8/+9
| | | | | | | | | | | | * test/lisp/calendar/time-date-tests.el (test-days-to-time) (test-time-since): Use time-equal-p to compare timestamps, since the default form shouldn’t matter.
* | Fix (date-to-time "2021-12-04")Paul Eggert2021-12-041-0/+7
|/ | | | | | | | | | | | | | | This should complete the fix for Bug#52209. * lisp/calendar/time-date.el (date-to-time): Apply decoded-time-set-defaults only to the output of (parse-time-string date), and only when the output has a year (to avoid confusion when dates lack years). There is no point applying it after timezone-make-date-arpa-standard since the latter fills in all the blanks. And the former code mistakenly called encode-time on an already-encoded time. This goes back to the code a couple of days ago, except with changed behavior (to fix Bug#52209) only when timezone-make-date-arpa-standard is not called. * test/lisp/calendar/time-date-tests.el (test-date-to-time) (test-days-between): New tests.
* Update copyright year to 2021Paul Eggert2021-01-011-1/+1
| | | | Run "TZ=UTC0 admin/update-copyright".
* `format-time' can now do sub-second timesLars Ingebrigtsen2020-10-301-1/+8
| | | | | | | * doc/lispref/os.texi (Time Parsing): Document it. * lisp/calendar/time-date.el (format-seconds): Allow formatting sub-second times.
* Use lexical-binding in time-date.el and expand testsStefan Kangas2020-10-221-1/+51
| | | | | | | | | | * lisp/calendar/time-date.el: Use lexical-binding. * test/lisp/calendar/time-date-tests.el (test-obsolete-with-decoded-time-value) (test-obsolete-encode-time-value, test-format-seconds) (test-days-to-time, test-seconds-to-string): New tests. (test-days-in-month, test-time-since, test-time-decoded-period): Expand test with a few more values.
* Fix off-by-one error in decoded-time-add (with months)Lars Ingebrigtsen2020-08-211-0/+20
| | | | | * lisp/calendar/time-date.el (decoded-time-add): Fix month addition, which was off-by-one.
* Add new function decoded-time-periodLars Ingebrigtsen2020-08-051-0/+14
| | | | * lisp/calendar/time-date.el (decoded-time-period): New function.
* Improve last changeEli Zaretskii2020-04-031-1/+2
| | | | | * lisp/calendar/time-date.el (date-days-in-month): Improve the error message text and make sure MONTH is a number. (Bug#40217)
* Error out if 'date-days-in-month' is given an invalid monthAlex Branham2020-04-031-1/+2
| | | | | | | * lisp/calendar/time-date.el (date-days-in-month): Add test for month validity; signal an error if it isn't. (Bug#40217) * test/lisp/calendar/time-date-tests.el (test-days-in-month): Add a test for the new error.
* Update copyright year to 2020Paul Eggert2020-01-011-1/+1
| | | | Run "TZ=UTC0 admin/update-copyright $(git ls-files)".
* Subtracting “now” from “now” should yield zeroPaul Eggert2019-08-161-1/+2
| | | | | | * src/timefns.c (time_arith): Arrange for (time-subtract nil nil) to yield 0, to be consistent with (time-equal-p nil nil). * test/lisp/calendar/time-date-tests.el (test-time-since): New test.
* format-time-string subsumes time-zone-formatPaul Eggert2019-07-311-6/+0
| | | | | | | | * lisp/calendar/time-date.el (time-zone-format): * test/lisp/calendar/time-date-tests.el (test-time-zone-format): Remove. * lisp/gnus/nnrss.el (nnrss-normalize-date): Use format-time-string instead of time-zone-format.
* Add new function time-zone-formatLars Ingebrigtsen2019-07-311-0/+6
| | | | * lisp/calendar/time-date.el (time-zone-format): New function.
* Adjust time-date tests to tweaked formatLars Ingebrigtsen2019-07-301-4/+4
|
* Add support for dealing with decoded time structuresLars Ingebrigtsen2019-07-291-0/+109
* doc/lispref/os.texi (Time Conversion): Document the new functions that work on decoded time. (Time Calculations): Document new date/time functions. * lisp/simple.el (decoded-time-second, decoded-time-minute) (decoded-time-hour, decoded-time-day, decoded-time-month) (decoded-time-year, decoded-time-weekday, decoded-time-dst) (decoded-time-zone): New accessor functions for decoded time values. * lisp/calendar/time-date.el (date-days-in-month) (date-ordinal-to-time): New functions. (decoded-time--alter-month, decoded-time--alter-day) (decoded-time--alter-second, make-decoded-time): New functions added to manipulate decoded time structures. * src/timefns.c (Fdecode_time): Mention the new accessors. * test/lisp/calendar/time-date-tests.el: New file to test the decoded time functions and the other new functions.