Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
solo-1
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
solo-1
Commits
8f252221
Unverified
Commit
8f252221
authored
Apr 15, 2018
by
Liang Ding
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
🐛
#12435
parent
347b3701
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
7 deletions
+20
-7
src/main/java/org/b3log/solo/repository/impl/ArchiveDateRepositoryImpl.java
...b3log/solo/repository/impl/ArchiveDateRepositoryImpl.java
+20
-7
No files found.
src/main/java/org/b3log/solo/repository/impl/ArchiveDateRepositoryImpl.java
View file @
8f252221
...
@@ -65,15 +65,28 @@ public class ArchiveDateRepositoryImpl extends AbstractRepository implements Arc
...
@@ -65,15 +65,28 @@ public class ArchiveDateRepositoryImpl extends AbstractRepository implements Arc
LOGGER
.
log
(
Level
.
TRACE
,
"Archive date [{0}] parsed to time [{1}]"
,
archiveDate
,
time
);
LOGGER
.
log
(
Level
.
TRACE
,
"Archive date [{0}] parsed to time [{1}]"
,
archiveDate
,
time
);
final
Query
query
=
new
Query
();
Query
query
=
new
Query
().
setFilter
(
new
PropertyFilter
(
ArchiveDate
.
ARCHIVE_TIME
,
FilterOperator
.
EQUAL
,
time
)).
setPageCount
(
1
);
query
.
setFilter
(
new
PropertyFilter
(
ArchiveDate
.
ARCHIVE_TIME
,
FilterOperator
.
EQUAL
,
time
)).
setPageCount
(
1
);
JSONObject
result
=
get
(
query
);
JSONArray
array
=
result
.
optJSONArray
(
Keys
.
RESULTS
);
if
(
0
==
array
.
length
())
{
// Try to fix wired timezone issue: https://github.com/b3log/solo/issues/12435
try
{
time
=
DateUtils
.
parseDate
(
archiveDate
,
new
String
[]{
"yyyy/MM"
}).
getTime
();
time
+=
60
*
1000
*
60
*
8
;
}
catch
(
final
ParseException
e
)
{
return
null
;
}
final
JSONObject
result
=
get
(
query
);
LOGGER
.
log
(
Level
.
TRACE
,
"Fix archive date [{0}] parsed to time [{1}]"
,
archiveDate
,
time
);
final
JSONArray
array
=
result
.
optJSONArray
(
Keys
.
RESULTS
);
if
(
0
==
array
.
length
())
{
query
=
new
Query
().
setFilter
(
new
PropertyFilter
(
ArchiveDate
.
ARCHIVE_TIME
,
FilterOperator
.
EQUAL
,
time
)).
return
null
;
setPageCount
(
1
);
result
=
get
(
query
);
array
=
result
.
optJSONArray
(
Keys
.
RESULTS
);
if
(
0
==
array
.
length
())
{
return
null
;
}
}
}
return
array
.
optJSONObject
(
0
);
return
array
.
optJSONObject
(
0
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment