-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update CmapaignService - add more business logic for other use cases
- Loading branch information
1 parent
26f6222
commit b9a7985
Showing
11 changed files
with
62 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 18 additions & 5 deletions
23
matcher/src/main/java/com/profile/matcher/utils/DateHelper.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,30 @@ | ||
package com.profile.matcher.utils; | ||
|
||
import java.sql.Timestamp; | ||
import java.text.SimpleDateFormat; | ||
import java.time.LocalDateTime; | ||
import java.time.format.DateTimeFormatter; | ||
|
||
import static com.profile.matcher.utils.Constants.DateTimePatterns.DATE_WITH_TIME; | ||
|
||
public final class DateHelper { | ||
|
||
public static String toFormattedDateTimeString(Timestamp dateTime) { | ||
if (null == dateTime) { | ||
public static String toFormattedDateTimeString(Timestamp timestamp) { | ||
if (null == timestamp) { | ||
return null; | ||
} | ||
SimpleDateFormat formatter = new SimpleDateFormat(DATE_WITH_TIME); | ||
return formatter.format(dateTime); | ||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern(DATE_WITH_TIME); | ||
LocalDateTime localDateTime = timestamp.toLocalDateTime(); | ||
|
||
return formatter.format(localDateTime); | ||
} | ||
|
||
public static Timestamp convertStringToTimestamp(String dateString) { | ||
if (null == dateString) { | ||
return null; | ||
} | ||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern(DATE_WITH_TIME); | ||
LocalDateTime localDateTime = LocalDateTime.parse(dateString, formatter); | ||
|
||
return Timestamp.valueOf(localDateTime); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters