package com.example.calendaryapp;


import java.util.Calendar;
public class TimeAlarmPicker{


    public TimeAlarmPicker(){

    }
    public int[] getTimeBlock(int block){
        int[] horario = {9,45};
        switch(block){
            case 2: horario[0] = 9;
                    horario[1] = 45;
                    break;
            case 3: horario[0] = 11;
                    horario[1] = 30;
                    break;
            case 4: horario[0] = 14;
                    horario[1] = 0;
                    break;
            case 5: horario[0] = 15;
                    horario[1] = 40;
                    break;
            case 6: horario[0] = 17;
                    horario[1] = 20;
                    break;
            case 7: horario[0] = 19;
                    horario[1] = 0;
                    break;
            case 1: horario[0] = 8;
                    horario[1] = 0;

        }
        return horario;
    }

    public Calendar onTimeSet(int bloque) {
        int[]actualHorario;
        actualHorario = getTimeBlock(bloque);
        Calendar c = Calendar.getInstance();
        c.set(Calendar.HOUR_OF_DAY, actualHorario[0]);
        c.set(Calendar.MINUTE, actualHorario[1]);
        c.set(Calendar.SECOND, 0);

        return c;
    }




}
