package com.physalix.jfx;

import java.text.SimpleDateFormat;
import java.util.Date;
import javafx.beans.property.SimpleObjectProperty;
import javafx.beans.property.SimpleStringProperty;
import javafx.beans.property.StringProperty;

/**
 * Birthday event jfx object.
 *
 * @author Fabrice Sommavilla <fs@physalix.com>
 */
public class BirthdayEvent {

    private final SimpleObjectProperty<Date> date;
    private final StringProperty name;

    /**
     *
     * @param name
     * @param date
     */
    public BirthdayEvent(String name, Date date) {
        this.name = new SimpleStringProperty(name);
        this.date = new SimpleObjectProperty(date);
    }

    /**
     * @return the name
     */
    public String getName() {
        return name.get();
    }

    /**
     * @param name the name to set
     */
    public void setName(String name) {
        this.name.set(name);
    }

    /**
     * @return the name
     */
    public StringProperty nameProperty() {
        return name;
    }

    /**
     *
     * @return
     */
    public Date getDate() {
        return (Date) date.get();
    }

    /**
     *
     * @return
     */
    public String getDateAsString() {
        SimpleDateFormat smp = new SimpleDateFormat("dd MMMMM yyyy");
        String strDate = (null == date || null == date.get())
                ? "" : smp.format(date.get());
        
        return strDate;
    }

    /**
     *
     * @param date
     */
    public void setDate(Date date) {
        this.date.set(date);
    }
}

@@ -1282,17 +1282,38 @@
 e = 
+%22%22;%0A%0A        if
 (null 
+!
 == 
+this.
 date
@@ -1321,19 +1321,25 @@
 %7C%7C null 
+!
 == 
+this.
 date.get
@@ -1341,16 +1341,18 @@
 e.get())
+ %7B
 %0A       
@@ -1360,18 +1360,17 @@
     
-    ? %22%22 :
+strDate =
  smp
@@ -1388,17 +1388,26 @@
 e.get())
-;
+%0A        %7D
 %0A       

Update BirthdayEvent.java