Comments (11)
I can't recreate this problem - it always looks correct to me.
Do you see this problem in the example on the docs page? If yes, then what browser are you using?
from heron.mudcalendar.
yes, in the docs page it is always jumping ahead between the lines, no matter what setting I use. for some reason in my project it jumps only on the lines, but still shows the incorrect time:
I tested the doc page with different browsers (Edge, Chrome, Firefox), time was 8:40 am:
could this be a localization issue? I'm in germany.
but I don't see why my project shows something different, while on the same machine (separate VM) it shows the same behavior on the doc page.
either way neither shows the correct time.
from heron.mudcalendar.
Yes, it is a localisation issue. I will fix that.
from heron.mudcalendar.
thanks
from heron.mudcalendar.
I have inserted the fixed code in my project, but unfortunately the time is still not correctly showing, although now the marker seems to move with each minute.
It seems so be shifted by about 10 minutes now.
Sorry for bothering.
from heron.mudcalendar.
Do you still have this problem? In the example you sent me it looks correct. Do you have the problem in all browsers?
from heron.mudcalendar.
Yes, the problem is still there, but as written before, the marker now moves with each minute.
actual time was 16:20 (I think it is showing 16:35, so it is shifted 15 minutes with each minute)
tested in Firefox, Chrome and Edge, same result
from heron.mudcalendar.
That's very strange I can't replicate this problem. Could you try debugging it yourself and see if you can find the problem.
from heron.mudcalendar.
As you might have figured out, I'm quite new to Blazor, but I managed to figure out, that the shift is always exactly half of the set interval, so +5 when in 10 minute interval and +30 when in 60 minute interval.
For now I fixed my indicator by changing TimelinePosition() in DayWeekViewBase.razor.cs
from this
var minutes = (int)Math.Floor(DateTime.Now.Subtract(DateTime.Today).TotalMinutes) - (TimelineRow() * (int)Calendar.DayTimeInterval);
to this
var minutes = DateTime.Now.Subtract(DateTime.Today).TotalMinutes - (TimelineRow() * (int)Calendar.DayTimeInterval) - (int)Calendar.DayTimeInterval / 2;
But obviously this is not a general fix.
I don't see why the localization is changing the outcome, since DateTime.Now already gives the local date and time.
I tried changing DateTime.Today to DateTime.Today.ToLocalTime(), which again puts the indicator right in the middle of the interval lines.
Maybe you can figure out more with this information.
If not I will leave it like that, because this page is not supposed to be used outside this timezone.
from heron.mudcalendar.
Where do you get this code from? The code in TimelinePosition() has never included Math.Floor().
The localization changes the output because some cultures use , as a decimal point and some cultures use .
The fix I applied was to use TimelinePosition().ToInvariantString() in the StyleBuilder() function.
from heron.mudcalendar.
Ah, sorry... I was experimenting with rounding the values, because I assumed it had to do with . vs. , as a decimal indicator, due to the whole localization issue.
I have inserted your fix, as stated before, which at least made the indicator move.
I meant so say:
I changed
var minutes = DateTime.Now.Subtract(DateTime.Today).TotalMinutes - (TimelineRow() * (int)Calendar.DayTimeInterval);
to
var minutes = DateTime.Now.Subtract(DateTime.Today).TotalMinutes - (TimelineRow() * (int)Calendar.DayTimeInterval) - (int)Calendar.DayTimeInterval / 2;
so subtracting half of the interval
This doesn't fix the origin of the problem, but for now does the job for me.
from heron.mudcalendar.
Related Issues (20)
- Grow the Day cell in the month view HOT 2
- When the ItemClicked event is enabled, a margin is added to the bottom of the page when Day view and Month view. HOT 1
- ItemChange Validation (Enhancement request)
- Upgrade to MudBlazor 7 Release Version
- Cannot assign custom item to the MudCalendar Items Parameter HOT 3
- Current Time Marker not rendering HOT 3
- MudCalendar not displaying properly. HOT 4
- Mudcalendar Wiki - API section not loading HOT 2
- View EnumSwitch styling discussion HOT 1
- Extending `CalendarItem` on `ItemChanged` and `ItemClicked` HOT 1
- CalendarItem HOT 2
- Day Week and WorkWeek view
- Expose FixDay/FixMonth/FixDay and OpenTo Discussion HOT 1
- Drag cursor applied even when EnableDragItems="false" for week, work week, and day views
- Breaking on latest version of Mudblazor HOT 4
- Cell Click Time issue (and others) HOT 2
- Clicking the next/prev week buttons in Work Week view only changes the date by 5 days
- Dispose exceptions
- Next future/previous event buttons HOT 2
- MudBlazor 7.7.0 not compatible HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from heron.mudcalendar.