1
0
mirror of https://github.com/rlanvin/php-rrule.git synced 2024-11-29 06:24:10 +01:00
Commit Graph

56 Commits

Author SHA1 Message Date
rlanvin
e3d5f8c629 Add support for Windows timezone
Fix #69
2019-09-01 13:08:55 +01:00
rlanvin
a5bda44f59 Remove space inside parenthesis to be closer to PSR-2 2019-01-14 13:09:43 +00:00
Ricky
58b9bd1115 Add remove/clear functions for ExDates and RDates (#66)
- Cleanup tests and comment
- Add removeExdate and clearExdates
- Add removeDate and clearDates for RDATEs
2019-03-17 10:45:34 +01:00
rlanvin
3d72c9efaf Add helpers methods
Ref #60
2019-01-13 13:44:01 +00:00
rlanvin
200b923c9e Add custom_path option to humanReadable
If the option is present, it'll first look for a file in this folder
before looking into the default folder.
Fix #56
2019-01-13 10:47:43 +00:00
David Stone
9fd853882c Fix error when timezone is an offset instead of an olson name. (#61)
* Fix error when timezone is an offset instead of an olson name.

intl returns the error "datefmt_create: no such time zone: '-05:00': U_ILLEGAL_ARGUMENT_ERROR"
if a DateTime object is passed as the second parameter into the RRule constructor.
IntlDateFormatter::create() needs the offset to be prefixed with GMT, go figure.
2019-01-13 10:29:25 +01:00
peter279k
8a3dd6d76a Test enhancement (#52) 2018-05-15 17:41:41 +01:00
Katy Ereira
39d229d0ce Null check to prevent 0 (false) values being lost. (#50) 2018-04-13 10:03:07 +01:00
rlanvin
c220aee917 Throw exception when passing float instead of int
e.g. INTERVAL=1.5
Before, it used to cast it silently
2017-05-09 17:02:03 +01:00
rlanvin
145c0817f7 Fix tests for PHP 5.6 and PHP 7.1
Fix bugs related to microseconds in PHP 7.1
2017-05-07 19:46:49 +01:00
rlanvin
e2f42382d4 Add $dtstart optional arg when creating from a string 2017-05-06 13:37:26 +01:00
rlanvin
7437503a73 Add $limit to getOccurrences and getOccurencesBetween 2017-05-06 13:37:21 +01:00
rlanvin
59d9226618 Rename 'dtsart' option to 'include_start' in humanReadable 2017-04-11 16:55:46 +01:00
rlanvin
67d4a5dc98 Refactor RFC string parsing
Add the possibility to construct a RSet from a string
Ref #26
2017-04-11 16:44:50 +01:00
rlanvin
a6d01f4036 Make RFC parser more strict 2017-04-11 14:20:42 +01:00
rlanvin
9b4681793d Add explicit_infinite and dtstart options to humanReadable 2017-04-11 11:20:20 +01:00
rlanvin
4ca0c62e0a Update travis.yml for php 7 and 7.1 2017-03-29 15:06:47 +01:00
rlanvin
51c7c5c56d Fix bug in RFC parser generating a invalid timezone
strtoupper() was creating invalid timezone, which would make
humanreadable() fail.
2017-03-29 14:20:00 +01:00
rlanvin
0714c4b97d Fix test failing with PHP 5.3 2017-02-03 00:39:19 +02:00
rlanvin
c29db6270e Refactor i18nLoad to attept to solve #24
- Rework `RRule::i18nLoad()` to accept locales such as `en_sg` and use `Locale::parseLocale` when possible
- Fix `humanReadable` fails with `intl` enable when the timezone is "Z"
2017-02-03 00:35:09 +02:00
rlanvin
0b3a2c9a32 Fix #25
- Fix parser handling of UNTIL when DTSTART is not provided
- Accept invalid RFC strings generated by the JS lib but triggers a Notice message
2017-02-02 19:30:10 +02:00
rlanvin
8d54335802 Add tests 2017-01-06 16:42:00 +02:00
rlanvin
0785c6ce7d Make offsetGet throw exception for illegal offset
Ref issue #22
2017-01-06 16:30:35 +02:00
rlanvin
dbcff3eb27 Fix a undefined index error in the RFC parser 2016-11-11 20:20:09 +02:00
rlanvin
9b8986b954 Add getter methods to RSet 2016-08-31 15:56:39 +03:00
Antoine Chabert
d7acacad6a Add tests to reveal the to RFC string error - Fix typo in variable of rfcString function of RRule 2016-08-17 23:14:38 +02:00
rlanvin
fe83f6de05 Change timezone names for PHP <= 5.4 2016-08-07 15:05:26 +03:00
rlanvin
0be4b1fb50 Forcing RRule create with a timezone to be in UTC #15
PHP's default is to put them in "+00:00" timezone, which
generates invalid RFC string.
The method rfcString() will convert all invalid timezones to
UTC to generate a valid RFC string.
2016-08-07 14:56:39 +03:00
rlanvin
7c041bfb42 Fix a bug in BYDAY
Fixed a bug when combining values with an integer modifier
and regular values in `BYDAY` (example `1MO,FR`)
2016-07-13 11:08:46 +03:00
rlanvin
d3d9c5090c Adding $include_timezone parameter to rfcString() 2016-06-30 14:03:44 +03:00
rlanvin
cb5735edd9 rfcString() formats DTSTART with a Z 2016-06-30 13:27:06 +03:00
rlanvin
97d860e55e Strictier RFC parser for dates (DTSTART and UNTIL)
Ref #13
2016-06-30 11:54:42 +03:00
rlanvin
7ae826d7da Add more tests for humanReadable and i18nLoad
Loosening the locale regexp even more, to accept locales such
as sr-Latn-RS
2016-04-04 16:34:57 +03:00
Gustavs Gūtmanis
4857e38d44 Adding support for fallback locale. 2016-04-03 16:41:30 +03:00
rlanvin
b527621fa5 Always cloning Datetime passed to parseDate to avoid any reference bug 2016-03-24 09:27:25 +02:00
rlanvin
3a84bcc6be Fix cache related bug at weekly frequencies 2016-03-24 09:23:11 +02:00
rlanvin
65886d99a2 Making sure DateTime objects are cloned
To avoid problems with cache corruption because DateTime are mutable
2016-03-23 16:00:40 +02:00
rlanvin
e0ca376396 Adding tests for occursAt + timezone
Ref #8
2016-03-23 12:03:43 +02:00
rlanvin
0cf1540f85 count, offsetExists and offsetGet for RSet
offsetGet is uncached at the moment (ref #7)
2016-03-21 23:56:35 +02:00
rlanvin
d2384c1997 Adding interface to make RSet behave like RRule
Recurrence rules and a recurrence sets now share the same interface.
Also added isFinite() and isInfinite() methods, and improved
the implementation of RSet (ref #7)
2016-03-21 22:43:38 +02:00
rlanvin
7e312eaf76 Adding a dedicated test for timezone 2016-03-11 11:02:40 +02:00
gordonzhao
4442384a6f Fix bug with timezone which is not UTC
- Add timezone to the Datetime creation
  - Add timezone to the rfcExample test
2016-03-11 15:42:34 +10:00
rlanvin
13626f66c5 Better string generation & parsing 2015-07-08 12:40:45 +03:00
rlanvin
fba57c4ef2 Various methods to convert from and to strings
- rfcString() (as well as __toString() to convert to RFC 5545
- parseRfcString() to parse RFC 5545
- humanReadable() to output the rule as a sentence

humanReadable is still a work in progress - in particular the
i18n and some BYXXX parts are not finished.
It also requires intl extension.
2015-07-07 19:19:35 +03:00
rlanvin
b1000a4afd Implementing cache, ArrayAccess and Countable 2015-07-02 17:12:48 +03:00
rlanvin
b3ec2fb271 Fix a bug with year 2038 on 32bits systems
There was still a few mktime() left. They have been replaced
by DateTime.
2015-07-01 14:14:05 +03:00
rlanvin
5f409deae9 Adding debug for failing test on Travis 2015-07-01 12:56:09 +03:00
rlanvin
8de2807d17 More tests, code cleanup 2015-07-01 12:23:39 +03:00
rlanvin
66e56cd4f9 Implementing BYSETPOS with freq > DAILY
Needs more tests
2015-06-30 18:19:09 +03:00
rlanvin
066a97d517 Implementing HOURLY/MINUTELY/SECONDLY frequencies
Also adding more tests and fixing bugs
BYSETPOS + time is still broken!!
2015-06-29 15:51:54 +03:00