README.md in fugit-1.6.0 vs README.md in fugit-1.7.0
- old
+ new
@@ -158,10 +158,37 @@
> For example, ``30 4 1,15 * 5'' would cause a command to be run
> at 4:30 am on the 1st and 15th of each month, plus every Friday.
Fugit follows this specification.
-There is a solution though, please read on.
+Since fugit 1.7.0, by adding `&` right after a day specifier, the `day-of-month OR day-of-week` becomes `day-of-month AND day-of-week`.
+
+```ruby
+# standard cron
+
+p Fugit.parse_cron('0 0 */2 * 1-5').next_time('2022-08-09').to_s
+ # ==> "2022-08-10 00:00:00 +0900"
+
+# with an &
+
+p Fugit.parse_cron('0 0 */2 * 1-5&').next_time('2022-08-09').to_s # or
+p Fugit.parse_cron('0 0 */2& * 1-5').next_time('2022-08-09').to_s
+p Fugit.parse_cron('0 0 */2& * 1-5&').next_time('2022-08-09').to_s
+ # ==> "2022-08-11 00:00:00 +0900"
+
+
+# standard cron
+
+p Fugit.parse_cron('59 6 1-7 * 2').next_time('2020-03-15').to_s
+ # ==> "2020-03-17 06:59:00 +0900"
+
+# with an &
+
+p Fugit.parse_cron('59 6 1-7 * 2&').next_time('2020-03-15').to_s
+p Fugit.parse_cron('59 6 1-7& * 2').next_time('2020-03-15').to_s
+p Fugit.parse_cron('59 6 1-7& * 2&').next_time('2020-03-15').to_s
+ # ==> "2020-04-07 06:59:00 +0900"
+```
### the hash extension
Fugit understands `0 5 * * 1#1` or `0 5 * * mon#1` as "each first Monday of the month, at 05:00".