Skip to content

Commit

Permalink
Merge pull request #76 from Link-MIND/test
Browse files Browse the repository at this point in the history
[Merge] test ๋ธŒ๋žœ์น˜ ๋จธ์ง€
  • Loading branch information
mmihye committed Jan 14, 2024
2 parents b4449f4 + 28b1d7a commit 837ce60
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.data.jpa.repository.config.EnableJpaAuditing;

import javax.annotation.PostConstruct;
import java.util.TimeZone;

@SpringBootApplication
@EnableJpaAuditing
public class ToasterApplication {
Expand All @@ -12,4 +15,8 @@ public static void main(String[] args) {
SpringApplication.run(ToasterApplication.class, args);
}

@PostConstruct
public void init() {
TimeZone.setDefault(TimeZone.getTimeZone("Asia/Seoul"));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,8 @@ public class TimerService {
private final CategoryRepository categoryRepository;
private final TimerRepository timerRepository;

// ํ‘ธ์‹œ์•Œ๋ฆผ ํ™œ์„ฑํ™”๊ฐ€ ํ•„์š”ํ•œ ๋กœ์ง์ด๋ผ๋ฉด, FCMService๋ฅผ ์ฃผ์ž…!
private final FCMService fcmService;

private LocalDateTime now;
private final Locale locale = Locale.KOREA;

@Transactional
public void createTimer(Long userId, CreateTimerRequestDto createTimerRequestDto){
Expand Down Expand Up @@ -173,7 +171,7 @@ private User findUser(Long userId){
// ์™„๋ฃŒ๋œ ํƒ€์ด๋จธ์ด๊ณ  ์•Œ๋žŒ์ด ์ผœ์ ธ์žˆ๋Š”์ง€ ์‹๋ณ„
private boolean isCompletedTimer(Reminder reminder){
// ํ˜„์žฌ ์‹œ๊ฐ„
now = LocalDateTime.now();
LocalDateTime now = LocalDateTime.now();

LocalTime futureDateTime = LocalTime.from(now.plusHours(1));
LocalTime pastDateTime = LocalTime.from(now.minusHours(1));
Expand Down Expand Up @@ -209,7 +207,7 @@ private WaitingTimerDto createWaitingTimerDto(Reminder reminder) {
// ์ธ๋ฑ์Šค๋กœ ์š”์ผ ์•Œ์•„๋‚ด๊ธฐ
private String mapIndexToDayString(int index) {
DayOfWeek dayOfWeek = DayOfWeek.of(index);
String dayName = dayOfWeek.getDisplayName(java.time.format.TextStyle.FULL, Locale.KOREAN);
String dayName = dayOfWeek.getDisplayName(java.time.format.TextStyle.FULL,locale);

return dayName.substring(0, 1);
}
Expand Down

0 comments on commit 837ce60

Please sign in to comment.