Closed zephyo closed 4 years ago
Seems to be a timezone problem. What is your OS timezone ? And your device timezone ?
PST, California! Ah - my bad, thought the widget automatically detected timezone.
On Sun, Feb 2, 2020 at 1:02 PM Hugo Delaunay notifications@github.com wrote:
Seems to be a timezone problem isn't it ? What is your OS timezone ?
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Skyost/FlutterWeekView/issues/9?email_source=notifications&email_token=AFPGKNVCKCJEX4EP3KIWJYLRA4YGFA5CNFSM4KO36U32YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEKSA46A#issuecomment-581176952, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFPGKNTZV5OMPSTAEWXFC7LRA4YGFANCNFSM4KO36U3Q .
-- Class of 2021 | Stanford University zephyo.github.io http://zephyo.github.io
Well, it should. I will investigate.
@zephyo If you try to execute the following code :
DateTime date = DateTime.now();
print('Hour : ${date.hour}, Minute : ${date.minute}.');
Are you getting the expected output ?
I'm also having the same problem, I ran the test and it was an hour earlier than the indicator.
@FernandaMayumi
@Skyost Brazil, GMT-03:00 Brasilia Standard Time
I ran the code above and gave my device an extra hour
@FernandaMayumi Hmm yes, so does the plugin. I'm gonna investigate and post my results in this issue.
Okay, according to various sources it seems to be a problem with Android emulators only. Btw as you can see by running the code snippet above, it's more of a bug from Flutter than from this plugin.
Please don't hesitate reopening if it happens on a physical device, I will try to find a fix that will also work on this plugin.
I'm also having this problem and I'm testing app on web platform.
My timezone is UTC+1 (Europe/Zagreb).
print("now: ${DateTime.now()}");
returns
now: 2020-02-13 11:32:20.025
and my system time is also 11:32, but red indicator is on 12:32.
I believe the problem is with adding +1 to hours when determining top offset in createCurrentTimeRule method.
Widget createCurrentTimeRule() {
DateTime now = DateTime.now();
return Positioned(
top: calculateTopOffset(now.hour + 1, now.minute),
left: widget.hoursColumnWidth,
right: 0,
child: Container(
height: 1,
color: widget.currentTimeRuleColor,
),
);
}
You are right @valentinkatic ! I don't really know why I've set hour + 1
, I think it was when I was using another system... Nevermind, it seems to be fixed anyway :wink:
To Reproduce Steps to reproduce the behavior:
Using Android emulator on Mac OS.