Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

schedule: wrong date/time/dayDelta on eventMove #3713

Closed
herbu123 opened this issue May 23, 2018 · 9 comments
Closed

schedule: wrong date/time/dayDelta on eventMove #3713

herbu123 opened this issue May 23, 2018 · 9 comments
Labels
🐞 defect Bug...Something isn't working
Milestone

Comments

@herbu123
Copy link

herbu123 commented May 23, 2018

Hi,

just move from 6.0 to 6.2. and fund the following bug (on 6.0 everything work fine).

When on the week view one move event exactly horizontally between days (same time) everything works fine. BUT when one change not only a day but also a time (to some later hour) the event date is calculated wrong (and delta day is wrong) - see picture and use the example below

calendarbug62

(I don't know why the image is not coming - it is uploaded here: https://ibb.co/cKgFrT )

xhtml:

`

<h:form id="test">
	<p:panel id="testPanel">

	    <p:schedule id="schedule" value="#{testBean.eventModel}" widgetVar="w_schedule"
		    	view="agendaWeek" >
		
	        <p:ajax event="eventMove" listener="#{testBean.onEventMove}" oncomplete="PF('w_schedule').update();" />
		</p:schedule>	
	</p:panel>
</h:form>	

`

bean:

`@ManagedBean(name = "testBean")
@nAmed
@scope("session")
public class TestBean implements Serializable {
private static final long serialVersionUID = -1178789140271997877L;

ScheduleModel eventModel = new DefaultScheduleModel();  
public void setServicesDAO(ServicesDAO servicesDAO) {
	this.servicesDAO = servicesDAO;
	

	DateTime dt = new DateTime();
	
	DefaultScheduleEvent event = new DefaultScheduleEvent ("desc", dt.toDate(), dt.plusHours(2).toDate());
	event.setTitle("title");

	eventModel.addEvent(event);
}


public ScheduleModel getEventModel() {
	return eventModel; 
}


public void onEventMove(ScheduleEntryMoveEvent event) {  
	SimpleDateFormat full_sdf = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss SSS");

	System.out.println( "StartDate: " + full_sdf.format(event.getScheduleEvent().getStartDate()) );
	System.out.println( "DayDelta: " + event.getDayDelta() );
}

}
`

Regards,
herbu

primefaces 6.2

@tandraschko
Copy link
Member

Again, please reuse our issue template. Also adding the whole bean, with annotations and correctly format your code.

@tandraschko tandraschko added the Resolution: Invalid Issue or pull request is not valid in the latest version label May 23, 2018
@herbu123 herbu123 changed the title calendar - wrong date/time/dayDelta on eventMove 6.2 bug schedule: wrong date/time/dayDelta on eventMove May 23, 2018
@herbu123
Copy link
Author

herbu123 commented May 23, 2018

Hello Thomas,

I have update the issue / added the missing code- still - I am pasting the formatted code but on preview it is not coming correctly - hope you can handle

/herbu

@herbu123
Copy link
Author

herbu123 commented May 25, 2018 via email

@tandraschko
Copy link
Member

JFYI: i won't check it. I just validate the issues here, to be in correct format. I'm doing this in my freetime and only check issues to "my related components/parts".
If you need help, i suggest PrimeFaces PRO, fix it by yourself and provide a PR, or wait until someone fixes it for you.

@tandraschko tandraschko added 🐞 defect Bug...Something isn't working and removed Resolution: Invalid Issue or pull request is not valid in the latest version labels May 25, 2018
@melloware
Copy link
Member

Is this similar or duplicate of this issue? #2296

@mbeedub
Copy link

mbeedub commented Aug 20, 2018

+1 for this.

It is still an issue.

@tandraschko
Copy link
Member

Feel free to fix it an provide a PR ;)

@melloware
Copy link
Member

Adding @OBreidenbach since he is the schedule expert. :) There are two open tickets around this issue that have been open for a while.

@OBreidenbach
Copy link
Contributor

Provide PR #3991, should also fix #2296.
The bug is visible in the showcase, if you moving events around the message growl shows the wrong values. So you can use the showcase to check if my fix is valid.

tandraschko added a commit that referenced this issue Aug 27, 2018
Fix #3713: delta days on moving and resizing events in scheduler
@tandraschko tandraschko added this to the 6.3 milestone Aug 27, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 defect Bug...Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants