File tree 2 files changed +20
-6
lines changed
2 files changed +20
-6
lines changed Original file line number Diff line number Diff line change @@ -2,10 +2,11 @@ format-ymd
2
2
Copyright (c) 2017 gknauth (Geoffrey S. Knauth)
3
3
4
4
This package is distributed under the GNU Lesser General Public
5
- License (LGPL). This means that you can link format-ymd into proprietary
6
- applications, provided you follow the rules stated in the LGPL. You
7
- can also modify this package; if you distribute a modified version,
8
- you must distribute it under the terms of the LGPL, which in
5
+ License (LGPL). This means that you can link format-numbers into
6
+ proprietary applications, provided you follow the rules stated in the
7
+ LGPL. You can also modify this package; if you distribute a modified
8
+ version, you must distribute it under the terms of the LGPL, which in
9
9
particular means that you must release the source code for the
10
- modified software. See http://www.gnu.org/copyleft/lesser.html
11
- for more information. For other licenses and consulting, please contact the author.
10
+ modified software. See https://www.gnu.org/licenses/lgpl-3.0.txt for
11
+ more information. For other licenses and consulting, please contact
12
+ the author.
Original file line number Diff line number Diff line change 139
139
(define (ymd8-d1-within-days-following-d0? d0 num-days d1)
140
140
(<= (ymd8-days-since d0 d1) num-days))
141
141
142
+ (define (every-ymd8-from-through start end)
143
+ (define (helper acc a b)
144
+ (cond [(= a b) (cons a acc)]
145
+ [else (helper (cons a acc) (ymd8-plusdays->ymd8 a 1 ) b)]))
146
+ (cond [(>= end start) (reverse (helper null start end))]
147
+ [else null]))
148
+
142
149
(module+ test
143
150
;; Tests to be run with raco test
144
151
(require rackunit)
145
152
(check-equal? (ymd8->ymd10 20170922 ) "2017-09-22 " )
146
153
(check-equal? (ymd8-plusdays->ymd8 20180401 60 ) 20180531 )
154
+ (check-equal? (every-ymd8-from-through 20191127 20191204 )
155
+ (list 20191127 20191128 20191129 20191130
156
+ 20191201 20191202 20191203 20191204 ))
157
+ (check-equal? (every-ymd8-from-through 20191127 20191127 )
158
+ (list 20191127 ))
159
+ (check-equal? (every-ymd8-from-through 20191127 20191120 ) null)
147
160
)
148
161
149
162
(module+ main
You can’t perform that action at this time.
0 commit comments