From 14e9ad62f44abff8ee190eb6adf8924317675dc4 Mon Sep 17 00:00:00 2001 From: Sujin Park Date: Thu, 26 Jun 2025 16:58:11 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20DateFormat(yyyy-MM-dd)=ED=8F=AC=EB=A7=B7?= =?UTF-8?q?=20=EC=88=98=EC=A0=95,=20getTyB=EC=9D=98=20||=EB=A5=BC=20&&?= =?UTF-8?q?=EB=A1=9C=20=EC=88=98=EC=A0=95,=20=EC=B2=AB=EB=B2=88=EC=9E=AC?= =?UTF-8?q?=EC=A1=B0=EA=B1=B4=EC=9D=84=20<4=EB=A1=9C=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .vscode/launch.json | 13 +++++++++++++ lib/dart_debug_sample.dart | 33 +++++++++++++++----------------- test/dart_debug_sample_test.dart | 5 +---- 3 files changed, 29 insertions(+), 22 deletions(-) create mode 100644 .vscode/launch.json diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..526fa11 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,13 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "name": "debug_exam", + "request": "launch", + "type": "dart" + } + ] +} \ No newline at end of file diff --git a/lib/dart_debug_sample.dart b/lib/dart_debug_sample.dart index 5472e58..12a8014 100644 --- a/lib/dart_debug_sample.dart +++ b/lib/dart_debug_sample.dart @@ -1,16 +1,14 @@ import 'package:intl/intl.dart'; class YukymController { - // DateTime.parse(_userData.value!.selectDate) - String nowDate = DateFormat('yyyy-mm-dd').format(DateTime.now()); + String nowDate = DateFormat('yyyy-MM-dd').format(DateTime.now()); late String nowTime; // 1. 자시의 국 : 갑자1국 = getTyOne()의 값 String getTyA() { - List timeDataOne = - _getTimeDataOne(nowDate); + List timeDataOne = _getTimeDataOne(nowDate); if (timeDataOne.isNotEmpty) { nowTime = timeDataOne.first.ty1; @@ -32,35 +30,34 @@ class YukymController { return nowTime; } else { // Handle the case when the list is empty - return '경오7국'; // Or any other appropriate action + return '경오7국'; // Or any other appropriate action } } String getTyB() { - List timeDataOne = - _getTimeDataOne(nowDate); + List timeDataOne = _getTimeDataOne(nowDate); String result = timeDataOne.first.ty12; final nowTime = DateTime.now(); - if (nowTime.hour >= 0 || nowTime.hour < 2) { + if (nowTime.hour >= 0 && nowTime.hour < 4) { return timeDataOne.first.ty1; - } else if (nowTime.hour >= 4 || nowTime.hour < 6) { + } else if (nowTime.hour >= 4 && nowTime.hour < 6) { return timeDataOne.first.ty2; - } else if (nowTime.hour >= 6 || nowTime.hour < 8) { + } else if (nowTime.hour >= 6 && nowTime.hour < 8) { return timeDataOne.first.ty3; - } else if (nowTime.hour >= 8 || nowTime.hour < 10) { + } else if (nowTime.hour >= 8 && nowTime.hour < 10) { return timeDataOne.first.ty4; - } else if (nowTime.hour >= 10 || nowTime.hour < 12) { + } else if (nowTime.hour >= 10 && nowTime.hour < 12) { return timeDataOne.first.ty5; - } else if (nowTime.hour >= 12 || nowTime.hour < 14) { + } else if (nowTime.hour >= 12 && nowTime.hour < 14) { return timeDataOne.first.ty6; - } else if (nowTime.hour >= 16 || nowTime.hour < 18) { + } else if (nowTime.hour >= 16 && nowTime.hour < 18) { return timeDataOne.first.ty7; - } else if (nowTime.hour >= 18 || nowTime.hour < 20) { + } else if (nowTime.hour >= 18 && nowTime.hour < 20) { return timeDataOne.first.ty8; - } else if (nowTime.hour >= 20 || nowTime.hour < 22) { + } else if (nowTime.hour >= 20 && nowTime.hour < 22) { return timeDataOne.first.ty9; - } else if (nowTime.hour >= 22 || nowTime.hour < 24) { + } else if (nowTime.hour >= 22 && nowTime.hour < 24) { return timeDataOne.first.ty10; } @@ -89,4 +86,4 @@ class YukymTimeModel { String ty10 = '갑자10국'; String ty11 = '갑자11국'; String ty12 = '갑자12국'; -} \ No newline at end of file +} diff --git a/test/dart_debug_sample_test.dart b/test/dart_debug_sample_test.dart index 71efb52..56113ac 100644 --- a/test/dart_debug_sample_test.dart +++ b/test/dart_debug_sample_test.dart @@ -1,8 +1,5 @@ -import 'package:dart_debug_sample/dart_debug_sample.dart'; import 'package:test/test.dart'; void main() { - test('', () { - - }); + test('', () {}); }