Coder Social home page Coder Social logo

calendar-component's People

Contributors

blackbluegl avatar danieljsv avatar dependabot[bot] avatar evanzel avatar neovmt avatar voltor avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

calendar-component's Issues

java.io.NotSerializableException

I get a java.io.NotSerializableException: java.time.format.DateTimeFormatter when the session gets serialized.

The issue does not seem to be adressed yet.

Label ignores time zone

Label in calendar ignores time zone. This is cause by no zoneId in formatter.
Test case:
LocalDateTime = 2019-11-08 09:16:00
Time zone = Europe/Bratislava (UTC+2)

Calendar timezone = Europe/London (UTC+1)
Label should be "8:16 AM", not "9:16 AM"

Screenshot:
Screenshot from 2019-11-08 09-16-35

Testcase example:
BasicItem basicItem = new BasicItem();
basicItem.setDescription("Test 1");
basicItem.setStart(ZonedDateTime.of(LocalDateTime.now(), ZoneId.of("Europe/Bratislava")));
basicItem.setEnd(ZonedDateTime.of(LocalDateTime.now().plusHours(1), ZoneId.of("Europe/Bratislava")));
BasicItemProvider basicItemBasicItemProvider = new BasicItemProvider<>();
basicItemBasicItemProvider.addItem(basicItem);

Calendar calendar = new Calendar<>(basicItemBasicItemProvider);
calendar.setWidth(100f, Unit.PERCENTAGE);
calendar.setHeight(100f, Unit.PERCENTAGE);
calendar.setZoneId(ZoneId.of("Europe/London"));
calendar.setFirstDayOfWeek(DayOfWeek.MONDAY);

setMinShownHours(int hours), setMaxShownHours(int hours)

Rather a feature request than a issue,

but it would be great to have the possibility to restrict the shown hours in the "single-day-view", because often you don't need the early morning hours in a business application and you don't want to waste the space for these ...

Maybe this is already possible right now and I couldn't find out how.

I know that there's the possibility to have a scrollbar, but this is really annoying for the user if he HAS to scroll every time he / she uses the widget. I think this would be a bad UX practice.

Any feedback would be appreciated!

I attached a screenshot to clarify what I mean:

2018-08-24 16_02_58-v8 demo stuff

Some issues found

1. height is fix, not matter set sizeFull or a larger height. <- this was my fault, the old style fixed the size...
2. rows are only rendered on today
strangerenderingcalendar <-- another style error
3. header column local is rendering dayname correctly but date format is not corresponding to locals one. See previous screenshot
4. style for calendar items does not work it does

Current hour don't use zoneId

Current hour don't use zoneId. I set the user's zoneId but the component get system default.

`
calendar = new Calendar<>(eventProvider);

    calendar.setZoneId(defaultZoneId);
    calendar.withDay(ZonedDateTime.now(defaultZoneId));
    calendar.withDayInMonth(ZonedDateTime.now(defaultZoneId));
    calendar.addStyleName("meetings");
    calendar.setWidth(100.0f, Unit.PERCENTAGE);
    calendar.setHeight(100.0f, Unit.PERCENTAGE);
    calendar.setResponsive(true);
    calendar.setItemCaptionAsHtml(true);
    calendar.setContentMode(ContentMode.HTML);
    calendar.withVisibleDays(1, 5);
    calendar.withVisibleHours(8, 18);
    calendar.setLocale(CurrentUser.get().getLocale());
    calendar.setTimeFormat(TimeFormat.Format24H);
    calendar.setStartDate(ZonedDateTime.of(2017, 9, 10, 0,0,0, 0, defaultZoneId));
    calendar.setEndDate(ZonedDateTime.of(2017, 9, 16, 0,0,0, 0, defaultZoneId));`

how it can support vaadin7.7.7 ?

sir, i want to use this calendar addon in my legacy project, vaadin version is 7.7.7, i try the branch V1.1, but it's seem not successfully , it exist any version addon match my request? thanks.

Calendar with PUSH pooling method

You have issue with polling method.
in Method beforeClientResponse(boolean initial) you always call setupCalendarItems(); , but with polling it always sets items when poolled.
It is interesting that it only happens when you are in Week view and scroll down a bit.

Wating for a fix asap!

Kristaps.

Request: Timeslot 15 minutes?

Hi,
at the moment the predefined timeslots are set to 30 minutes.
Would it be possible to change it to 15 minutes? Maybe configurable?

Thanks and regards,
Marcel

Stretch a full day event in the month view

This is more like a feature request. I'd like to have the possibility to stretch a full day event if that event is only one on that day like this:

image

Is this somehow possible in the current version?
Thanks, cheers.

Month view: Week row height bug

SCENARIO:
1 - clone the code source 2.0.1
2 - remove the row "calendar.setHeight(100.0f, Unit.PERCENTAGE);" calendar-component-demo -> MeetingCalendar::initCalendar
image
3 - run the project

EXPECTED:
image

ACTUALLY:
image

Switch off day and week view, change listener

Hi! As Iā€™m pretty new to the calendar addon, Iā€™d appreciate your help.

  1. I want to switch off day and week calendar view, leaving only the monhly view. Do you guys happen to know how to do that? So far I managed to show monthly view as the defaul one.

  2. I want to redirect to custom page when the user clicks a day in calendar. Also, any help appreciated!

Thanks in advance!

Retain style name when switching from month/week/day mode

In month mode, I set the style name for each calendar item per my color preference. However, when switching to the week or day mode, the style name is reset to default. Is there a way to retain or set the style name when the week or day mode is activated?

Change ZoneDateTime API to LocalDateTime

I'm wondering why the calendar API was changed to use ZoneDateTime instead of LocalDateTime? I was thinking it would be better to have the public API all be LocalDateTime so applications don't have to constantly convert back and forth. Inside the Calendar's private methods ZoneDateTime would be figured out using the ZoneID set on the calendar.

Also I don't see ZoneDateTime used on the DateField Vaadin component. So it might also be more consistent as well.

BasicBackwardHandler Daily Mode Problem

In BasicBackwardHandler class there is a bug in finding previous day in daily mode (Same bug exists in BasicForwardHandler). If not showing weekends on calendar (getFirstVisibleDayOfWeek => 1, getLastVisibleDayOfWeek => 5), when you press back button on Monday (i expect to see previous friday) there is a bug at line :
dayOfWeek = start.get(ChronoField.DAY_OF_WEEK);
It has to be:
dayOfWeek = newDate.get(ChronoField.DAY_OF_WEEK);

Calendar Days not Responding to Locale Changes?

Hello,

First, thank you for working on a Calendar add-on for Vaadin. The framework most certainly needs a calendar.

I cannot figure out how to change the order of the days in the Calendar. The default order is:

Mon, Tue, Wed, Thu, Fri, Sat, Sun

but this does not match the typical US calendar. I want the days to be in the following order:

Sun, Mon, Tue, Wed, Thu, Fri, Sat

Code example:

calendar = new Calendar<>(eventProvider);
calendar.setLocale(Locale.ENGLISH);
calendar.markAsDirty();

Thank you for your time!

Full-day events in week modus are sometimes misaligned

Problem

When the calendar displays multiple full-day events in week modus that overlap, in some cases the UI incorrectly aligns the event bars when a certain events stops. This problem however doesn't occur when using the calendar in month mode.

calendar_week_view_misalignment

Steps to reproduce

  1. Add 2 events:
    1.1. One from Monday till Thursday
    1.2. One from Tuesday till Sunday

Also Tested

  • Adding the same data to the demo project - Same problem
  • Sorting events based on end date - Same problem

Version

2.0.1

Your "all-day-calculation" seems to be broken

I noticed that the thin beam for all-day-appointments in your calendar appears not only, when an appointment takes from 00:00 to 00:00 of the next day, but also if an appointment is longer than 24 hours.
For example:
If an appointment starts today at 13:00 oclock and ends tomorrow at 14:00 oclock, the cal recognizes this as a all-day-appointment for today AND tomorrow and shows its all-day-beam for these two days.
But its not a all-day-event for even one of these two days.
If I set the end time of this appointment back to 12:30 the event shows in cal like a normal event.

cal1
cal2

Month view : Add possibility to set the minimum number of days in the first week : feature

The first week of the year calculation can differ per country or region. Therefore, it will be nice to have the possibility to configure it independently from any Windows or browser settings, so that the user can set it.

The feature will depend on the 'minimum number of days in the first week' and 'first day of week' configurations.
If the 'minimum number of days in the first week' or 'the first day of the week' values are null, the feature uses the 'locale' value by default.

Daterange is too big (max 60) = 61

While testing the addon on Vaadin 8, I came across a runtime error. The strange thing is it only happens when you jump from March to April in month mode. You can reproduce the error by overriding the BasicForwardHandler forward(ForwardEvent event) method.

		// Forward handler
		accountCalendar.setHandler(new BasicForwardHandler() {
			/**
			 * 
			 */
			private static final long serialVersionUID = 1L;

			/*
			 * (non-Javadoc)
			 * 
			 * @see
			 * org.vaadin.addon.calendar.handler.BasicForwardHandler#forward(org.vaadin.
			 * addon.calendar.ui.CalendarComponentEvents.ForwardEvent)
			 */
			@Override
			public void forward(ForwardEvent event) {
				ZonedDateTime bstart = event.getComponent().getStartDate();
				ZonedDateTime bend = event.getComponent().getEndDate();
				
				long bduration = Duration.between(bstart, bend).toDays();

				System.out.println("Before super start " + bstart);
				System.out.println("Before super end " + bend);
				System.out.println("Before super duration " + bduration);
				
				
				// Let the super handle the rest
				super.forward(event);
				
				ZonedDateTime astart = event.getComponent().getStartDate();
				ZonedDateTime aend = event.getComponent().getEndDate();
				
				long aduration = Duration.between(bstart, bend).toDays();
				
				System.out.println("After super start " + astart);
				System.out.println("After super end " + aend);
				
				System.out.println("After super duration " + aduration);
			}
		});

Stacktrace

java.lang.RuntimeException: Daterange is too big (max 60) = 61
at org.vaadin.addon.calendar.Calendar.setupDaysAndActions(Calendar.java:595)
at org.vaadin.addon.calendar.Calendar.beforeClientResponse(Calendar.java:323)
at com.vaadin.server.communication.UidlWriter.write(UidlWriter.java:126)
at com.vaadin.server.communication.AtmospherePushConnection.push(AtmospherePushConnection.java:168)
at com.vaadin.server.communication.PushHandler.lambda$new$1(PushHandler.java:149)
at com.vaadin.server.communication.PushHandler.callWithUi(PushHandler.java:248)
at com.vaadin.server.communication.PushHandler.onMessage(PushHandler.java:534)
at com.vaadin.server.communication.PushAtmosphereHandler.onMessage(PushAtmosphereHandler.java:87)
at com.vaadin.server.communication.PushAtmosphereHandler.onRequest(PushAtmosphereHandler.java:77)
at org.atmosphere.cpr.AsynchronousProcessor.action(AsynchronousProcessor.java:225)
at org.atmosphere.cpr.AsynchronousProcessor.suspended(AsynchronousProcessor.java:114)
at org.atmosphere.container.Servlet30CometSupport.service(Servlet30CometSupport.java:67)
at org.atmosphere.cpr.AtmosphereFramework.doCometSupport(AtmosphereFramework.java:2297)
at org.atmosphere.websocket.DefaultWebSocketProcessor.dispatch(DefaultWebSocketProcessor.java:594)
at org.atmosphere.websocket.DefaultWebSocketProcessor$3.run(DefaultWebSocketProcessor.java:345)
at org.atmosphere.util.VoidExecutorService.execute(VoidExecutorService.java:101)
at org.atmosphere.websocket.DefaultWebSocketProcessor.dispatch(DefaultWebSocketProcessor.java:340)
at org.atmosphere.websocket.DefaultWebSocketProcessor.invokeWebSocketProtocol(DefaultWebSocketProcessor.java:448)
at org.atmosphere.container.JSR356Endpoint$3.onMessage(JSR356Endpoint.java:272)
at org.atmosphere.container.JSR356Endpoint$3.onMessage(JSR356Endpoint.java:269)
at org.apache.tomcat.websocket.WsFrameBase.sendMessageText(WsFrameBase.java:395)
at org.apache.tomcat.websocket.server.WsFrameServer.sendMessageText(WsFrameServer.java:119)
at org.apache.tomcat.websocket.WsFrameBase.processDataText(WsFrameBase.java:495)
at org.apache.tomcat.websocket.WsFrameBase.processData(WsFrameBase.java:294)
at org.apache.tomcat.websocket.WsFrameBase.processInputBuffer(WsFrameBase.java:133)
at org.apache.tomcat.websocket.server.WsFrameServer.onDataAvailable(WsFrameServer.java:82)
at org.apache.tomcat.websocket.server.WsFrameServer.doOnDataAvailable(WsFrameServer.java:171)
at org.apache.tomcat.websocket.server.WsFrameServer.notifyDataAvailable(WsFrameServer.java:151)
at org.apache.tomcat.websocket.server.WsHttpUpgradeHandler.upgradeDispatch(WsHttpUpgradeHandler.java:148)
at org.apache.coyote.http11.upgrade.UpgradeProcessorInternal.dispatch(UpgradeProcessorInternal.java:54)
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:53)
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:834)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1415)
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:748)

Month view: entries for one day are not displayed in chronological order

Later appointments are displayed before earlier appointment in month view. The error always seems to occur when an entry has more than a "30 minutes" timeslot.

Steps to reproduce:

  • Compile the demo and run jetty.
  • Visit localhost:8080.
  • You are presented with the week view.
  • Add an entry by clicking on the 09:00 timeslot on one day.
  • Use the same day but this time add an entry which uses two consecutive timeslots (e.g. 10:00am-11:00am).
  • Switch to month view. The 10:00AM entry will be above the 9:00AM entry in the month view.

week view:
01

month view:
02

Switch view mode

Hello!
Is it possible to switch view mode (month, week, day) from server side?
(e. g. setMode(Mode.WEEK))

SetHeight to 100% gives wrong height

When calendar.SetHeight is 100% it gives a bigger height than it should and the last row is usually cut off.
It is more apparent with bigger sizes.

To be fair, it is the same in Vaadin 7 and in Vaadin 8 compatibility packages.
See also open issue vaadin/framework#8333

Apparently only in monthly View.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    šŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ā¤ļø Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.