All Downloads are FREE. Search and download functionalities are using the official Maven repository.

jfxtras.labs.scene.control.scheduler.skin.SchedulerMonthSkin Maven / Gradle / Ivy

There is a newer version: 9.0-r1
Show newest version
package jfxtras.labs.scene.control.scheduler.skin;

import jfxtras.labs.scene.control.scheduler.Scheduler;

import java.time.LocalDate;
import java.util.ArrayList;
import java.util.List;

/**
 * @author Tom Eugelink
 * @author Islam Khachmakhov
 */
public class SchedulerMonthSkin extends SchedulerSkinAbstract {

    /**
     *
     */
    public SchedulerMonthSkin(Scheduler control) {
        super(control);
    }

    /**
     * Assign a calendar to each day, so it knows what it must draw.
     */
    protected List determineDisplayedLocalDates()
    {
        // the result
        List lLocalDates = new ArrayList<>();

        // From 1st day of this month to the end
        LocalDate lStartLocalDate = LocalDate.now().withDayOfMonth(1);
        for (int i = 0; i < LocalDate.now().lengthOfMonth(); i++) {
            lLocalDates.add(lStartLocalDate.plusDays(i));
        }

        // done
        return lLocalDates;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy