jidefx.scene.control.field.popup.LocalDateTimePopupContent Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jidefx-fields Show documentation
Show all versions of jidefx-fields Show documentation
JideFX Common Layer is a collection of several extend feature for JavaFX
The newest version!
/*
* @(#)LocalDatePopupContent.java 5/19/2013
*
* Copyright 2002 - 2013 JIDE Software Inc. All rights reserved.
*/
package jidefx.scene.control.field.popup;
import java.time.LocalDate;
import java.time.LocalDateTime;
/**
* A PopupContent for LocalDateTime.
*/
public class LocalDateTimePopupContent extends AbstractDatePopupContent {
private LocalDateTime _oldValue = null;
@Override
public LocalDateTime fromLocalDate(LocalDate localDate) {
if (_oldValue != null) {
return _oldValue.with(localDate);
}
return null;
}
@Override
public LocalDate toLocalDate(LocalDateTime value) {
_oldValue = value;
return value == null ? null : LocalDate.from(value);
}
}