Package org.richfaces.fragment.calendar.TimeSpinner

Examples of org.richfaces.fragment.calendar.TimeSpinner.TimeSignSpinner


        int hours = (getHoursSpinner() != null ? getHoursSpinner().getValue() : getDefaultHours());
        DateTime result = new DateTime()
            .withHourOfDay(hours)
            .withMinuteOfHour(minutes)
            .withSecondOfMinute(seconds);
        TimeSignSpinner tss = getTimeSignSpinner();
        if (tss != null) {
            switch (tss.getValue()) {
                case AM:
                    if (result.getHourOfDay() == 12) {//12:xx am -> 00:xx
                        result = result.minusHours(12);
                    }
                    break;
View Full Code Here


    }

    private TimeEditor setTime(int hours, int minutes, int seconds, SetValueBy by) {
        TimeSign timeSign = null;
        TimeSpinner<Integer> actSecondsSpinner = getSecondsSpinner();
        TimeSignSpinner acttimeSignSpinner = getTimeSignSpinner();
        if (acttimeSignSpinner != null) {//there is a time sign spinner, --> fix the hours
            timeSign = TimeSign.AM;
            if (hours >= 12) {
                timeSign = TimeSign.PM;
            }
            if (hours > 12) {//>12h -> XXh pm
                hours -= 12;
            }
            if (hours == 0) {//00:xx -> 12:xx am
                hours = 12;
            }
        }
        getHoursSpinner().setValueBy(hours, by);
        getMinutesSpinner().setValueBy(minutes, by);
        if (actSecondsSpinner != null) {
            actSecondsSpinner.setValueBy(seconds, by);
        }
        if (acttimeSignSpinner != null) {
            acttimeSignSpinner.setValueBy(timeSign, by);
        }
        return this;
    }
View Full Code Here

TOP

Related Classes of org.richfaces.fragment.calendar.TimeSpinner.TimeSignSpinner

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.