Klondike Dragon
d2e1443c4d
Comprehensive date format validation
...
Audit every stateDate so every unexpected alternative will fail.
In the process, fixed some newly found bugs:
* Extend format yyyy-mon-dd to allow times to follow it. Also allow full month name.
* Allow full day name before month (e.g., Monday January 4th, 2017)
Relevant confirmatory test cases were added.
2023-12-16 22:31:48 -07:00
Klondike Dragon
23f8fa1af0
Further optimize ambiguous parsing
...
Optimize the common and special case where mm and dd are the same length, just swap in place. Avoids having to reparse the entire string.
For this case, it's about 30% faster and reduces allocations by about 15%.
This format is especially common, hence the reason to optimize for this case.
Also fix the case for ambiguous date/time in the mm:dd:yyyy format.
2023-12-16 13:52:00 -07:00
Klondike Dragon
0c3943eacd
Support RabbitMQ log format (dd-mon-yyyy::hh:mm:ss)
...
Adapt https://github.com/araddon/dateparse/pull/122 by https://github.com/bizy01 to add support for RMQ log format. Refactor to avoid redundant code. Add format validations.
As a side note, will also support the format dd-mm-yyyy:hh:mm:ss.
2023-12-15 20:22:47 -07:00
Klondike Dragon
249dd7368c
Support git log format (Thu Apr 7 15:13:13 2005 -0700)
...
Adapt commit 99d9682a1c
from https://github.com/araddon/dateparse/pull/92 by https://github.com/jiangxin (merge timeWsYearOffset case and validate format)
2023-12-15 17:42:07 -07:00
Klondike Dragon
18ec8c69f6
Expand Chinese date format support
...
Inspired by https://github.com/araddon/dateparse/pull/132 from https://github.com/xwjdsh -- made this more general to all time formats that could follow, and added format validation.
Also include the related README.md touchup from https://github.com/araddon/dateparse/pull/136
2023-12-15 17:14:03 -07:00
Klondike Dragon
cc63421875
Support times after yyyy.mm.dd dates
...
Fix for this bug mentioned in https://github.com/araddon/dateparse/pull/134
Also, the other cases mentioned in this PR are not valid formats, so add them to the TestParseErrors test, to document that this is expected.
2023-12-14 23:47:31 -07:00
Klondike Dragon
23869f345e
Add support for mm/dd/yyyy, hh:mm:ss
...
Incorporate PR https://github.com/araddon/dateparse/pull/156 from https://github.com/BrianLeishman and adapt to also validate the format
2023-12-14 23:14:26 -07:00
Klondike Dragon
14fb9398e4
Fix parsing for format (time) UTC[+-]NNNN
...
Fixes https://github.com/araddon/dateparse/issues/158
2023-12-14 22:57:42 -07:00
Klondike Dragon
2b3f700718
Handle format "date time (MST)"
...
Was unable to handle standalone timezone in parentheses before.
Also update tests to indicate expected timezone name for all tests that are parsed in a specific location.
With updated logic/fixes, add tests to verify:
* Fix https://github.com/araddon/dateparse/issues/71
* Fix https://github.com/araddon/dateparse/issues/72
2023-12-13 23:58:04 -07:00
Klondike Dragon
8f0059d6da
Add tests to verify ambiguous cases
...
Test cases now validates the following is true:
* Fixed https://github.com/araddon/dateparse/issues/91
* Fixed https://github.com/araddon/dateparse/issues/28
(previous commits already addresses these issues, these tests ensure
that these issues remain fixed)
2023-12-12 23:40:07 -07:00
Klondike Dragon
df9ae2e32a
Incorporate support for yyyymmddhhmmss.SSS
...
Incorporate PR https://github.com/araddon/dateparse/pull/144 from
https://github.com/dferstay to fix
https://github.com/araddon/dateparse/issues/143
2023-12-12 23:19:35 -07:00
Klondike Dragon
fc278d32da
Incorporate support for dd-mm-yyyy (digit month)
...
Incorporate PR https://github.com/araddon/dateparse/pull/140 from
https://github.com/dferstay to fix
https://github.com/araddon/dateparse/issues/139
This also fixes https://github.com/araddon/dateparse/issues/155
(duplicate of issue 139)
PR is adapted to avoid duplicate code and validate format.
2023-12-12 23:07:11 -07:00
Klondike Dragon
18938f16ae
Implement support for yyyy mon dd (2013 May 02)
...
Incorporate PR https://github.com/araddon/dateparse/pull/142 from
https://github.com/dferstay to fix
https://github.com/araddon/dateparse/issues/141
2023-12-12 21:42:48 -07:00
Klondike Dragon
301ffeee02
Add support for mon/dd/yyyy (Oct/31/1970)
2023-12-12 21:24:17 -07:00
Klondike Dragon
49f9259ee3
Add support for dd[th,nd,st,rd] Month yyyy
...
Incorporate PR https://github.com/araddon/dateparse/pull/128 from
https://github.com/krhubert to fix
https://github.com/araddon/dateparse/issues/127
2023-12-12 20:18:58 -07:00
Klondike Dragon
c62ed15d73
Support PMDT and AMT time zones
...
Also disallow PM and AM from being specified twice in the string.
Fixes https://github.com/araddon/dateparse/issues/149
2023-12-12 17:42:09 -07:00
Klondike Dragon
3ebc8bc635
Incorporate fix for dd.mm.yyyy format
...
Incorporates PR https://github.com/araddon/dateparse/pull/133 from https://github.com/mehanizm to fix https://github.com/araddon/dateparse/issues/129
Adds test cases to verify the following are already fixed:
* https://github.com/araddon/dateparse/issues/105
2023-12-11 23:46:44 -07:00
Klondike Dragon
1b1e0b3d33
Add extensive format validation, bugfixes
...
* Don't just assume we were given one of the valid formats.
* Also consolidate the parsing states that occur after timePeriod.
* Add subtests to make it easier to see what fails.
* Additional tests for 4-char timezone names.
* Fix https://github.com/araddon/dateparse/issues/117
* Fix https://github.com/araddon/dateparse/issues/150
* Fix https://github.com/araddon/dateparse/issues/157
* Fix https://github.com/araddon/dateparse/issues/145
* Fix https://github.com/araddon/dateparse/issues/108
* Fix https://github.com/araddon/dateparse/issues/137
* Fix https://github.com/araddon/dateparse/issues/130
* Fix https://github.com/araddon/dateparse/issues/123
* Fix https://github.com/araddon/dateparse/issues/109
* Fix https://github.com/araddon/dateparse/issues/98
* Addresses bug in https://github.com/araddon/dateparse/issues/100#issuecomment-1118868154
Adds test cases to verify the following are already fixed:
* https://github.com/araddon/dateparse/issues/94
2023-12-11 23:45:58 -07:00
Arran Ubels
01b692d1ce
Another case.
2023-02-16 09:39:34 +11:00
Arran Ubels
8b765a5302
Skip white space
2023-02-15 23:37:23 +11:00
Arran Ubels
19ef6a25eb
New failure - still white space
2023-02-15 17:34:02 +11:00
Arran Ubels
c5a1edc710
My addition last
2023-02-15 16:24:05 +11:00
Arran Ubels
544b5426f4
Test improvements.. I think
2023-02-15 16:20:46 +11:00
Arran Ubels
4345a38e91
Another error
2023-02-15 15:57:15 +11:00
Arran Ubels
2fb4c46691
S1021: should merge variable declaration with assignment on next line (gosimple)
2023-02-15 15:50:42 +11:00
Arran Ubels
26d95ba3e6
My issue
2023-02-15 15:46:27 +11:00
radaiming
5dd51ed0f7
Fix possible panic
2021-04-28 23:23:48 +08:00
Aaron Raddon
0eec95c9db
New date format 2020-07-20+00:00 fixes #110
2021-02-06 16:14:29 -08:00
Aaron Raddon
36fa6fb41d
fix TZ-location override for format fixes #113
2021-02-06 15:23:24 -08:00
Aaron Raddon
0360d1282f
Support len 2 TZ offsets: 2019-05-29T08:41-04 fixes #111
2021-02-06 13:42:06 -08:00
Aaron Raddon
bbfb8e0022
Workfront date format, closes #117
2021-02-05 15:19:04 -08:00
Aaron Raddon
30cb7ba0f9
new date format, fixes #116
2021-02-05 13:44:33 -08:00
Aaron Raddon
bc0a6620c3
Code cleanup & code-coverage, doc from #120
2021-02-05 13:11:38 -08:00
liushaobo
ab345927d5
测试完善
2021-02-04 16:11:30 +08:00
liushaobo
e92c493a75
完善代码
2021-02-04 15:51:24 +08:00
liushaobo
a7e3619d47
扩充时间格式
2021-02-04 14:23:19 +08:00
liushaobo
b87b24a51f
提交代码
2021-02-03 18:10:39 +08:00
Aaron Raddon
9cb150cd12
Merge pull request #89 from troyspencer/master
...
Options framework to allow more control over parsing
2020-09-30 12:45:49 -07:00
Aaron Raddon
b85a51b06c
Merge branch 'master' into colon-separator
2020-09-30 12:38:26 -07:00
Aaron Raddon
293071ed83
Code cleanup, remove un-used code after #103
2020-09-30 12:17:37 -07:00
asannikov
95c11657d1
Added extra test cases
2020-06-17 23:01:20 +02:00
asannikov
9e5141594f
Add colon date format mm:dd:yy hh:mm:ss
2020-06-17 22:55:25 +02:00
Charles Duffy
661394b510
Parse glibc strftime %c format ( #102 )
...
This change trims day-of-week prefixes before entering into the parsing loop. This corrects parsing of glibc's strftime `%c` timestamps, and should allow significant simplification of the state machine in the future.
2020-05-05 21:10:24 -05:00
troyspencer
aca798503a
Wrote tests for 100% coverage
...
Update RetryAmbiguousDateWithSwap detection logic after testing
2019-08-12 20:38:23 -05:00
Philippe Horne
0f77464124
Added a test to cover the 4 year date when dealing with dates of the type 28-Feb-2018.
2019-06-19 15:53:12 -04:00
Philippe Horne
dd780a39a3
Added fix to parse dates of the format 28-Feb-18 and 28-Feb-2018.
2019-06-19 13:28:39 -04:00
ferhat elmas
b0e14136e9
Fix ordinal parsing due to copy
2019-04-26 01:42:47 +02:00
Aaron Raddon
c4a7a0dec4
new format closes #76
2019-02-22 16:50:43 -08:00
Aaron Raddon
21df004e09
Additional missed format for refs #74 date format with rd
2018-11-23 09:12:28 -08:00
Aaron Raddon
313f117957
new date formats closes #73 and closes #74
2018-11-22 13:54:48 -08:00