Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
Y
yzg-util
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
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
YZG
yzg-util
Commits
61769a83
Commit
61769a83
authored
Sep 21, 2019
by
yanzg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
接口文档的支持
parent
aa1ba98b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
0 deletions
+22
-0
DateHelper.java
...src/main/java/com/yanzuoguang/util/helper/DateHelper.java
+22
-0
No files found.
yzg-util-base/src/main/java/com/yanzuoguang/util/helper/DateHelper.java
View file @
61769a83
...
...
@@ -32,6 +32,28 @@ public class DateHelper {
private
static
final
int
MONTH_11
=
11
;
private
static
final
int
MONTH_12
=
12
;
/**
* 判断日期是否需要初始化,当需要时,返回新的日期
*
* @param initDay 历史初始化日期
* @param content 新的日期
* @return 新的日期
*/
public
static
final
String
getInitDay
(
String
initDay
,
String
content
)
{
String
today
=
DateHelper
.
getToday
();
String
contentDay
=
DateHelper
.
getToday
(
content
);
if
(!
StringHelper
.
isEmpty
(
initDay
))
{
initDay
=
DateHelper
.
getToday
(
initDay
);
if
(
StringHelper
.
compare
(
contentDay
,
initDay
))
{
return
StringHelper
.
EMPTY
;
}
}
if
(!
StringHelper
.
compare
(
contentDay
,
today
))
{
return
StringHelper
.
EMPTY
;
}
return
today
;
}
/**
* 获取时间
*
...
...
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