Java Code Examples for ims.framework.utils.Date.equals()

The following are Jave code examples for showing how to use equals() of the ims.framework.utils.Date class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
Example 1
Project: AvoinApotti   File: AdHocDateSelectionImpl.java   Source Code and License Vote up 6 votes
public Boolean isExcludedDate(Date date)
{
	ExclusionDates impl = (ExclusionDates) getDomainImpl(ExclusionDatesImpl.class);
	ExclusionDatesVo exDate = impl.listExclusionDates();

	if (exDate == null)
		return false;

	for (int i = 0; i < exDate.getDates().length; i++)
	{
		if (date.equals(exDate.getDates()[i]))
		{
			return true;
		}
	}

	return false;
}
 
Example 2
Project: AvoinApotti   File: Logic.java   Source Code and License Vote up 6 votes
public int compare(Object arg0, Object arg1)
{
	final int EQUAL  = 0;
	final int AFTER  = 1;
    
	SpecimenWorkListItemListVo voObj1 = (SpecimenWorkListItemListVo) arg0;
	SpecimenWorkListItemListVo voObj2 = (SpecimenWorkListItemListVo) arg1;
	Date startDateToCollect = voObj1.getDateToCollect();
	Date endDateToCollect 	= voObj2.getDateToCollect();
	Time startTimeToCollect = voObj1.getTimeToCollect();
	Time endTimeToCollect 	= voObj2.getTimeToCollect();
	
	if(startDateToCollect != null && endDateToCollect != null)
	{
		//Covers only equal dates and null time (Date Time sort moved into hql query)
		if(startDateToCollect.equals(endDateToCollect))
		{
			if(startTimeToCollect == null && endTimeToCollect != null)
			{
				return AFTER;
			}
		}
	}
	
	return EQUAL;
}
 
Example 3
Project: AvoinApotti   File: Logic.java   Source Code and License Vote up 5 votes
public int compare(Object arg0, Object arg1)
{
	final int EQUAL = 0;
	final int AFTER = 1;

	SpecimenWorkListItemListVo voObj1 = (SpecimenWorkListItemListVo) arg0;
	SpecimenWorkListItemListVo voObj2 = (SpecimenWorkListItemListVo) arg1;
	Date startDateToCollect = voObj1.getDateToCollect();
	Date endDateToCollect = voObj2.getDateToCollect();
	Time startTimeToCollect = voObj1.getTimeToCollect();
	Time endTimeToCollect = voObj2.getTimeToCollect();

	if (startDateToCollect != null && endDateToCollect != null)
	{
		// Covers only equal dates and null time (Date Time sort moved
		// into hql query)
		if (startDateToCollect.equals(endDateToCollect))
		{
			if (startTimeToCollect == null && endTimeToCollect != null)
			{
				return AFTER;
			}
		}
	}

	return EQUAL;
}
 
Example 4
Project: AvoinApotti   File: Logic.java   Source Code and License Vote up 4 votes
private String[] validateUIRules()
{
	List<String> uiErrors = new ArrayList<String>();

	
	if( form.dtimDischargeDateTime().getValue() == null )
	{
		uiErrors.add("Discharge Date/Time is mandatory !");//WDEV-16843
	}
	else
	{
		if( form.dtimDischargeDateTime().getValue().isGreaterThan(new DateTime()))
		{
			uiErrors.add("Discharge Date/Time cannot be set it in the future");
		}
		else if(form.getLocalContext().getAdmissionDetailIsNotNull() && form.getLocalContext().getAdmissionDetail().getTransferHistoryIsNotNull()  && form.getLocalContext().getAdmissionDetail().getTransferHistory().size() > 0 ) //wdev-16770
		{
			
			DateTime dtimD = getTheLastWardTransferDateTime(form.getLocalContext().getAdmissionDetail());
			if( dtimD != null)
			{
			
   				Date dtD = dtimD.getDate();
   				Time tD = dtimD.getTime();
   				
   				Date dtD1 = form.dtimDischargeDateTime().getValue().getDate();
   				Time tD1 = form.dtimDischargeDateTime().getValue().getTime();
   				if( dtD1.isLessThan(dtD))
   					uiErrors.add("Discharge Date/Time must be later than or equal to the last Ward transfer Date/Time");
   				else if(dtD1.equals(dtD))
   				{
   					if( tD1.isLessThan(tD))
   						uiErrors.add("Discharge Date/Time must be later than or equal to the last Ward transfer Date/Time");
   				}
			}
		}
		else if(form.getLocalContext().getAdmissionDetailIsNotNull() && form.dtimDischargeDateTime().getValue().isLessThan(form.getLocalContext().getAdmissionDetail().getAdmissionDateTime()))
		{
			uiErrors.add("Discharge Date/Time must be later than or equal to the Admission Date/Time");
		}
	}
	
	
	if( form.cmbDischargeReason().getValue() == null)
	{
		uiErrors.add("Discharge Reason is mandatory.");
	}
	
	String[] result = new String[uiErrors.size()];
	uiErrors.toArray(result);
	return result;
}