mirror of
https://github.com/tanrax/RSSPAPER.git
synced 2025-11-25 12:06:14 -05:00
Fix date filter
This commit is contained in:
@@ -1,12 +0,0 @@
|
||||
log4j.rootLogger=DEBUG, R
|
||||
#Output to the file, and a new file is generated when the file size reaches the specified size
|
||||
log4j.appender.R=org.apache.log4j.RollingFileAppender
|
||||
#Output to the console
|
||||
#log4j.appender.stdout=org.apache.log4j.ConsoleAppender
|
||||
#log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
|
||||
log4j.appender.R.File=./log/logger1.log
|
||||
|
||||
log4j.appender.R.MaxBackupIndex=20
|
||||
|
||||
log4j.appender.R.layout=org.apache.log4j.PatternLayout
|
||||
log4j.appender.R.layout.ConversionPattern=[%d][%p][%c] %m%n
|
||||
@@ -17,11 +17,11 @@
|
||||
|
||||
(defn filter-edition
|
||||
[articles]
|
||||
(let [daily (- (c/to-long (t/now)) 86400)
|
||||
weekly (- (c/to-long (t/now)) 604800)]
|
||||
(let [daily (c/to-long (t/minus (t/now) (t/days 1)))
|
||||
weekly (c/to-long (t/minus (t/now) (t/weeks 1)))]
|
||||
(case (:edition config)
|
||||
"daily" (filter (fn [article] (> (:published-date article) daily)) articles)
|
||||
"weekly" (filter (fn [article] (> (:published-date article) weekly)) articles)
|
||||
"daily" (filter (fn [article] (>= (:published-date article) daily)) articles)
|
||||
"weekly" (filter (fn [article] (>= (:published-date article) weekly)) articles)
|
||||
:else articles)))
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user