Rob Emery
503dc9d911
Merge pull request #2060 from GuiltyDolphin/datemath-improvements
...
DateMath: Improvements
2016-02-21 12:25:46 +00:00
Ben Moon
ebf686c6a1
Allow lowercase trailing TZs
...
E.g., cet rather than CET
2016-02-03 19:31:34 +00:00
Ben Moon
1915f773e9
Provide access to time regexes
...
time_24h_regex for 24 hour clocks
time_12h_regex for 12 hour clocks
2016-02-03 19:30:22 +00:00
Ben Moon
3927595492
Fix some whitespace
2016-02-03 19:30:22 +00:00
Ben Moon
47daa8b593
Update to fall-back on time-zone offset
2016-02-03 19:30:22 +00:00
Ben Moon
fd97b48e33
Add support for 24hr clock in display
2016-02-03 19:30:22 +00:00
Ben Moon
3c7c92c85b
Fix issue with time-zone not being added correctly
2016-02-03 19:30:22 +00:00
Ben Moon
db88b11d1d
Add support for %d %b %Y %T %Z format
...
Essentially HTTP format without the day and allowing any timezone.
2016-02-03 19:30:22 +00:00
Ben Moon
98a43daef8
Fix rounding issue
...
Using `sprintf` was causing rounding to ~ 5 dp, definitely not what
we want!
Using Math::BigFloat should be fine, as styling numbers should not occur
en masse - only during conversions to/from user input.
2016-01-13 21:17:59 +00:00
Mailkov
495f61b856
changes tag <a> to <span>
2015-11-21 11:03:49 +00:00
Mailkov
c1882cfcdb
Issue #1491 - Chess960: Remove clickable link from result
2015-11-21 10:00:26 +00:00
Zaahir Moolla
03651cc8b8
Merge pull request #1294 from duckduckgo/mintsoft/date-role/relatives
...
DateRole: Tests and fixes
2015-09-11 16:43:59 -04:00
Zaahir Moolla
81b7116ce1
Merge pull request #1348 from duckduckgo/mintsoft/week-update_with_dates
...
Continuation: Convert Week Goodie to Structured Template, update tests
2015-08-10 09:34:08 -04:00
Zaahir Moolla
0415f0b6a4
Merge pull request #1082 from rouzbeh/Chess960HTML
...
Chess960: Use HTML output provided by FenViewer
2015-08-05 23:52:40 -04:00
Rob Emery
91b9107669
Adding tests around is_valid_year
2015-07-31 21:48:40 +01:00
Rob Emery
998c43b42a
Week: Fixing handling around invalid weeks and years
2015-07-31 21:36:52 +01:00
Rob Emery
2009310571
DatesRole: Adding full_year regex and accessor
2015-07-31 21:22:04 +01:00
cwallen
8aa0d47817
Change our to accessor function
2015-07-19 18:02:35 +00:00
cwallen
a4ab113476
Fix MSK timezone and consolidate timezone lists.
2015-07-19 04:43:36 +00:00
Bujiraso
096fd0ffce
Dates role now parses relative terms from today
2015-07-12 13:54:27 +00:00
Bujiraso
d45f03a0d8
Fixed Dates role to copy an object before using it
2015-07-12 02:20:24 +00:00
rouzbeh
7afa7d2fb9
GoodieRole: Add the Chess role
2015-04-06 16:51:55 +00:00
Rob Emery
3db537d529
DatesRole: parse_all_datestrings_to_date will now use the first date as a base for ambiguous formats
2015-02-01 17:39:43 +00:00
W25
9f4604eeb6
Reverted the unnecessary 'in X days' check
2014-12-27 08:59:29 +00:00
W25
dada468e2d
Added more tests
2014-12-25 16:23:31 +00:00
W25
d561cec4ba
Removed today/yesterday trigger, added 'in 5 days'
2014-12-25 07:33:53 +00:00
Mitchell Perilstein
4d30565e11
revised: push logic into consumer of Dates.pm
2014-12-05 15:22:26 -05:00
Mitchell Perilstein
4a612c2f7c
One-liner fix for issue #773 and new unit tests to exercise that area.
2014-11-29 18:48:23 -05:00
Matt Miller
fe1729edf1
Calculator: add structured answer.
2014-11-15 21:35:39 +02:00
Matt Miller
9fa8c14464
NumberStyler: allow for space and underscore separation.
...
This allows people to enter numbers in a more visually kind way,
without breaking the general paradigm.
2014-11-14 00:01:15 +02:00
Rob Emery
64bcbb87db
DatesRole: Fixing regression with "next <month>" introduced by dodgey merging
2014-11-02 22:37:47 +00:00
Rob Emery
4bad1f8e67
DatesRole: Fixing regression on singlename months
2014-11-02 22:27:58 +00:00
Rob Emery
56f0c7529a
Merge branch 'mintsoft/relative_dates' of github.com:duckduckgo/zeroclickinfo-goodies into mintsoft/relative_dates
...
Conflicts:
lib/DDG/GoodieRole/Dates.pm
t/00-roles.t
t/CalendarToday.t
2014-10-31 21:48:19 +00:00
Matt Miller
665dd0c3e5
DatesRole: grab $loc info off the calling package.
...
As one might suspect, the testing is the difficult part with per-instance
"package variables.
I welcome more comprehensive tests, but I don't know that I am up to
creating them.
2014-10-31 18:27:53 +02:00
Rob Emery
8170857b08
DatesRole: making util "nominally private"
2014-10-31 18:27:09 +02:00
Rob Emery
f192992a30
DatesRole: Ternaries ftw!
2014-10-31 18:27:09 +02:00
Rob Emery
bcb0404d0c
DatesRole: Fixing *stupid* mistake in regex
2014-10-31 18:27:09 +02:00
Rob Emery
eb745ab474
DatesRole: Removing prototype from util sub
2014-10-31 18:26:31 +02:00
Rob Emery
98d0adb403
DatesRole: refactoring into utility function
2014-10-31 18:26:31 +02:00
Rob Emery
3ca4f6ccf5
DatesRole: Expanding test coverage and first (probably broken) implementation
2014-10-31 18:26:31 +02:00
Rob Emery
cf246bb9d4
DatesRole: Adding regex and failing tests for new proseque formats
2014-10-31 18:26:31 +02:00
Rob Emery
a99f8a29e7
DatesRole: Tidying up
2014-10-31 18:26:31 +02:00
Rob Emery
6f79f3a123
DatesRole: Clarifying terrible comment
2014-10-31 18:26:31 +02:00
Rob Emery
7c6679b3fb
DatesRole: Renaming misleading regex
2014-10-31 18:26:31 +02:00
Matt Miller
ab20f6c8e0
DatesRole: add "this" week|month|year.
...
At this point,all of them are essentially aliases for "today", but the
logic is kept separate in case we want to move them to start of period
or similar.
Minor update on Chinese Zodiac to demonstrate it working through the
role instead of local triggering.
2014-10-31 18:26:31 +02:00
Matt Miller
592375e883
DatesRole: definededness not truthiness for parsing.
...
I don't know that we'd ever need to actually support year 0 or similar,
but there may come a day where we support epochs or something and it
might make sense.
2014-10-31 18:26:31 +02:00
Rob Emery
97a7541706
DatesRole: minor cleanup
2014-10-31 18:26:31 +02:00
Matt Miller
ffd257aa09
DatesRole: fix and expand relative dates.
...
- Add grouping to regex for proper |ing.
- Add 'year' to relative dates. (See Chinese zodiac)
- Add more tests.
2014-10-31 18:26:31 +02:00
Rob Emery
d12154fdc0
DatesRole: Minor tidyup
2014-10-31 18:25:59 +02:00
Rob Emery
76edd1de1d
DatesRole: Adding rough implementation for relative times
2014-10-31 18:25:59 +02:00