Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Took features from article and made them execute. That's all of this.…
… Initial checkin.
- Loading branch information
Showing
12 changed files
with
47 additions
and
47 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
12 changes: 11 additions & 1 deletion
12
src/main/java/shoe/example/schedule/BusinessDateTimeAdjuster.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,16 +1,26 @@ | ||
package shoe.example.schedule; | ||
|
||
import org.joda.time.DateTime; | ||
import org.joda.time.DateTimeUtils; | ||
import org.joda.time.MutableDateTime; | ||
import org.springframework.stereotype.Component; | ||
|
||
|
||
// <codeFragment name = "BusinessDateTimeAdjuster"> | ||
@Component | ||
public class BusinessDateTimeAdjuster { | ||
public void resetToSystemTime() { | ||
DateTimeUtils.setCurrentMillisSystem(); | ||
} | ||
|
||
public void setTimeTo(int hour, int minute) { | ||
DateTimeUtils.setCurrentMillisFixed(DateTimeFactory.todayAt(hour, minute).getMillis()); | ||
DateTimeUtils.setCurrentMillisFixed(todayAt(hour, minute).getMillis()); | ||
} | ||
|
||
DateTime todayAt(int hour, int minute) { | ||
MutableDateTime dateTime = new MutableDateTime(); | ||
dateTime.setTime(hour, minute, 0, 0); | ||
return dateTime.toDateTime(); | ||
} | ||
} | ||
// </codeFragment> |
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