package Models.TraiteClt;

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 TraiteList {

    private final SimpleObjectProperty<Date> dateTraite;
    private final StringProperty MontantTraite;

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

    /**
     * @return the MontantTraite
     */
    public String getMontantTraite() {
        return MontantTraite.get();
    }

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

    /**
     * @return the MontantTraite
     */
    public StringProperty MontantTraiteProperty() {
        return MontantTraite;
    }

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

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

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