Translate daynumber to date in APEX calendar

Hello all,
I've got a problem with a query for a calendar.
My current customer has two tables to see wether or not an employee is available.
One to see if an employee has parttime hours.
EMP_CALENDAR
- empno number
- day_name varchar2(24)
- day_number number
- work_hours number
- non_work_hours number
Each employee gets 5 rows. One for each workday of the week showing 0 to 8 in the work_hours and non_work_hours column.
And one to see if an employee has time-off.
EMP_NON_AVAILABILITIES
- empno number
- start_date date with timestamp
- duration number
- description varchar2(255)
My predicament is that I have to build screens with monthly calendars and week calendars to show both data.
A query for the non-availabilities is easy enough, because I have a date field available. Using the timestamp I can show it correctly in a week calendar. But showing the part-time hours is a bit more challenging.
Can anybody help me with this? I don't have a clue how to transform the EMP_CALENDAR data to integrate with the EMP_NON_AVAILABILITIES data when using an APEX calendar.
The trouble is that I can translate a single date to a workday without a problem, but the APEX calendar only gives me 1 date; the CALENDAR_DATE. The other days of the week aren't available in an ITEM as far as I know.

I've found a solution myself. I don't think it's very pretty, but it does the trick.
select empno display_value
     , start_date return_value
  from emp_non_availabilities
where empno = :APP_USER
union all
select empno display_value
     , dd.return_date return_value
  from emp_calendar
     , (SELECT (to_date(:P110_CALENDAR_DATE,'YYYYMMDD') + (LEVEL-7)) return_date
          FROM DUAL
       CONNECT BY LEVEL < 14) dd
where day_number = to_char(dd.return_date,'D')
   and empno = :APP_USERI have to select 14 days from 7 days before :P110_CALENDAR_DATE until 7 days after, so I can get all data for my weekcalender. I don't know in advance which day of the week my CALENDAR DATE will be.

Similar Messages

  • Change Color on selected date in APEX calendar

    Hello all,
    Does anyone know that how to change the background color of the date once it has been clicked?

    Swetha
    I created an application using Apex. It is a calendar application to show events that are happening. I ran into an issue with it
    If there is an event that occurs during an interval like August15 - August22, the event is shown only on August15, which is the first day of the event. I would like to show it in all days from August15-22.
    Here are the items coming from the page
    event_id number,
    employee_id number
    date_from date,
    date_to date,
    due_date date,
    act_id number,
    act_loc varchar2,
    reminder varchar2,
    frequency varchar2,
    division varchar2,
    event_status varchar2
    I am looking to write a process / procedure where it can show the same event on all the days it is occurring
    Thanks in advance
    Latha

  • Display all dates between a start and end date on an Apex Calendar

    Hi Guys,
    I am encountering an issue where Apex doesn't display the data from a valid query in a Calendar.
    I have a simple table used to capture events data with the following columns and data:
    event_id   start_date   end_date
    1           20-APR-09   22-APR-09
    2           24-APR-09   24-APR-09Using an Apex Calendar I would like to display the continuous dates of an event on each relevant date, so in the above example I would like to see Event ID 1 shown on the 20th, 21st & 22nd April in the Calendar.
    I have created the following query :
    SELECT     ees.event_id,
               ees.start_date + LEVEL - 1 AS date_range
    FROM       dual
             , (SELECT ee.event_id,
                       (ee.start_date) AS start_date,
                       (ee.end_date)   AS end_date
                FROM   ees_event ee  ) ees
    CONNECT BY LEVEL <= (ees.end_date - ees.start_date + 1)the results from this query list the dates as I require them in terms of an ID and a row for each date in the date range.
    I then wrap this query into a view and use that to base an Apex Calendar on and the when I run the page nothing is displayed on the Calendar?!
    Does anyone have any tips or pointers please?
    Kind regards,
    stu

    A bit more digging and once again I have found my solution on Denes' website - thanks for such and excellent resource!
    Solution I have used can be found here:
    http://apex.oracle.com/pls/otn/f?p=31517:83:4441524250972745::NO

  • How do you use the "Item Containing Start/End Date" in a Calendar?

    Hi
    I want to do a calendar where the days shown will be conditional to a certain interval. Now I though I could achieve that using the Item Containing Start Date of a calendar. But it doesn't seem to work. In the help it says :
    Enter an item in the application which holds the start date of the calendar. The format of the date in this item must be YYYYMMDD.
    This is what I did here
    http://apex.oracle.com/pls/otn/f?p=34530:1::::::
    I have 3 fields. 2 for the Start Date and End Date and 1 for the "Date Item" parameter. Only the latter has an effect on the calendar display, the calendar only displays the month of the "Date Item" (in monthly mode).
    Wether or not I check "Begin at Start of Interval", it doesn't affect the way those fields are affecting the Calendar.
    So, how do we use that "Item Containing Start/End Date" parameter?

    Hello,
    does yout Script work when you begin with ?:
    Start-Process powershell -Verb runAs
    Best regards,
    Stefan
    German Orchestrator Portal ,
    My blog in English

  • Apex Calendar synchronize with Google Calendar

    Hi Friends,
    i have create an calendar region and i have enter my new appointment details on 15 november at 3:00 Pm .
    Then these value would be show on my calendar .
    But i want to see this appintment in google calendar also.
    How Can i synchronize apex Calendar with google Calendar.
    How can i do this.
    Thanks

    Hi 805629,
    I don't have the exact answers to your questions... but some extra details might help others.
    i.e. Which way do you want to synchronize - google to oralce; oracle to google; both? Does it need to be automated?
    Not too sure how easy an automated synchronization would be. Check out this thread: Is there a way to generate an .ics or .vcs file from an APEX calendar? on exporting the ICS file (which you would be able to upload into Google Calendar).
    You may want to check out this site - http://code.google.com/apis/calendar/ - In particular, the Data API. You should be able to get your app to create events directly in the google calendar when you create them in APEX. But again, I haven't dealt with this.
    By the way, what is the reasons for wanting synchronization between a google calendar and an apex calendar? (as opposed to just having the google calendar embedded in your site)
    Good luck :-)
    Ta,
    Trent

  • ApEx Calendar Region - enhanced behavior using JavaScript

    Hi everyone,
    I recently wrote about the built in calendar. Comments/remarks are welcome! :)
    http://insum-apex.blogspot.com/2008/07/apex-calendar-enhanced-behavior.html
    Louis-Guillaume
    Homepage : http://www.insum.ca
    Blog : http://insum-apex.blogspot.com

    Hi Emma,
    You could do it with an POP-UP LOV and Dynamic Action.
    Dynamic Action
    - Change
    - item P65_STAFF_ID
    True Actions
    1 - PL/SQL block;
         - PL/SQL Code in this block you can get the last of first date for the absence of the STAFF_ID and put it in the date item for the calendar (eg P65_CALENDAR_DATE);
         - Page Items to Submit P65_STAFF_ID
         - Page Items to Return P65_CALENDAR_DATE
    2 - Execute Javascript Code
         - apex.widget.calendar.ajax_calendar('M','same',$v('P65_CALENDAR_DATE'));
    This way the calendar will be refreshed and set to the date in P65_CALENDAR_DATE.
    You can also put "null;" in the PL/SQL block, leave the Page Items to Return empty and remove the ",$v('P65_CALENDAR_DATE')" part from the Javascript code. This way you do not open the calendar at the right date.
    I made a small example at http://apex.oracle.com/pls/apex/f?p=14257:4 (login as demo/demo).
    Regards,
    Kees Vlek
    <tt>Company: http://www.orcado.nl
    Blog: http://www.orcado.nl/blog/blogger/listings/69-kvlek
    Twitter: http://www.twitter.com/skier66</tt>
    If the question is answered please change it to answered and mark the appropriate post as correct/helpfull.

  • APEX Calendar Help - I'm stuck!

    Hello,
    First let me preface this by saying I am not an APEX expert and have been learning on the fly for the past few weeks. As a trainer for my organization it was important to have a dynamic training and events calendar with some specific features. I found a pre-packaged [Sample Calendar|http://www.oracle.com/technetwork/developer-tools/apex/application-express/packaged-apps-090453.html] application, uploaded that and have modified it to fit about 90% of my needs. Here is where I am stuck:
    1. I need to change how the events sort. I need alpha sorting, ideally.
    2. I currently have two different calendar groupings, soon to be three. Meaning, I have some events labelled as Training & Events and others labelled as Birthdays. I would like to color code these on my calendar so that it is clear to users what is what. I know how to change the highlighting color of all events, but not how to specify based on an identifiable column in my table.
    3. I created a page to reflect event details. When you click on a given event, it redirects to another page and shows the name, date, start time, web conference and dial-in details. The problem is the latter two items are showing blank when there is data in my table. Ideas?
    Any help or guidance is greatly appreciated. I am using APEX 4.2.
    Thank you,
    Christina

    Hi,
    1. I need to change how the events sort. I need alpha sorting, ideally. - The current calendar design overrides your sorting and uses the Calendar date column instead. There is a workaround for this provided your Calendar is SQL based.
    select display_column, cast(date_column as timestamp) + numtodsinterval('0.00' || rownum,'SECOND') shift_date, sort_column from
    (select display_column, date_column, sort_column
    from your_table
    order by sort_column desc)
    http://sathishkumarjs.blogspot.in/2013/05/trick-to-sort-apex-calendar-data-based.html
    2. I currently have two different calendar groupings, soon to be three. Meaning, I have some events labelled as Training & Events and others labelled as Birthdays. I would like to color code these on my calendar so that it is clear to users what is what. I know how to change the highlighting color of all events, but not how to specify based on an identifiable column in my table. -
    To acheive this yo need to modify the SQL statement with additional case statement to get the color of your choice and modify the display column as custom and add the column value as background/foreground color of your choice this needs some custom HTML / this also can be achieved by Modifying the Calendar Template. if needed will blog this with practical example.
    3. I created a page to reflect event details. When you click on a given event, it redirects to another page and shows the name, date, start time, web conference and dial-in details. The problem is the latter two items are showing blank when there is data in my table. Ideas? -
    If you mean some data columns displays correctly will others does not show data, want you to check the data source of those columns, whether it is similar to columns which work fine, if not want to know does the columns which does not display the value is in anyway related to display / date column used by calendar.
    thanks
    Sathish

  • Apex calendar report url problems

    Hi
    im having problems with the "day link" attribute in an apex calendar report.
    i have the calendar set up so that when you click the date in the calendar it sends the date formatted correctly to the date picker field in my create a new appointment page. so pre-populating the field as the page is loaded.
    initially i used the standard "page in this application" function and passed the substitute string #DD# #MON# #YYYY# to the date picker item P6_APT_DATE, setting the link to go to page 6 etc....
    this actually works fine but apex converts in into a URL
    f?p=&FLOW_ID.:6:&SESSION.::&DEBUG.:6:P6_APT_DATE:#DD#-#MON#-#YYYY#
    which does exactly the same thing. and both work perfectly
    However - nether are saved by apex? if i go back to edit the report the "day link" section is blank but both continue to work even when i refresh / re-cache the page.
    i have had similar happen in the past when the link isn't formatted correctly, the problem here is that it all works fine until you go back in to edit the calendar report, at which point the url / links vanish.
    im just starting out with apex so my apologies if i have missed anything obvious. any help would be appreciated
    regards - Solomon Hill
    Message was edited by:
    SolomonHill

    Solomon,
    I'm not sure exactly how your calendar page works, but the # character cannot appear in URLs except as an named-anchor reference.
    If you can show me your app on apex.oracle.com, I'll take a closer look.
    Scott

  • Apex Calendar

    The APEX calendar region has built in buttons to navigate to the next, previous and current months. I have a report region next to my calendar that displays every month that has data in my calendar table and I have made the month a link but I am not sure how to make the calendar switch to that particular month when I click the link.

    Hi,
    You will need to have the built in item ':pXXX_calendar_date' updated by the link in your report with the proper date in this format 'YYYYMMDD'. This will change what date the calendar is looking at. This will work
    Cheers Mike
    Edited by: MikesHotRod on Sep 2, 2008 9:04 AM

  • Is it possible to select multiple dates from a calendar?

    Hi All,
    I am looking for a way of somehow selecting more than one date in the Apex calendar. What I am after is something like in Outlook you can select 5 days for one action.
    Is something like that (or simmilar) is possible with Apex?
    Regards,
    Pawel.

    Boy, this is something we're struggling with too. So we'd like to hear others' ideas on this also.
    thank you,
    iggy

  • Using htp.p for print dynamic data in apex region make my page slow?

    Hi, everyone!!! My name is Rafael, and...
    I search in the web and in this forum but i can´t find a answer for my doubt.
    Using the procedure htp.p for print dynamic data in apex region through on demand process , this will leave my webpage slow to load when the user access?
    Example:
    For build a menu in my webpage, it´s read a function in the database that returns variable string, so by a demand process this string is obtain and print in a web page using htp.p.
    I notice that this practice causes slow to load the data on the page.
    This is it...
    If someone help me, thanks...
    bye and Happy new Year!!!
    Edited by: user9518141 on 26/12/2009 17:19

    Hi,
    Try commenting out the function call and print some sample text in the htp.p like htp.p('Hello world..');
    I think the function call is probably taking a lot of time .. not htp.p.
    I have used htp.p to print out values dynamically in a lot of situations and have not ever come across any performance issues.It could be a problem with the function you are calling.
    Thanks,
    Rajesh.

  • Can I restore a single calendar archive to iCal without replacing my current ical data in other calendars?

    I archived an iCal calendar.  When I went to import it back into iCal, a message says "The iCal backup “abcd.icbu” will replace your current iCal data. You can’t undo this action."  Will it replace ALL my current iCal data, or just any data in a calendar labeled "abcd"?

    imci,
    As the warning says: "...will replace your current iCal data." All of your current data will be overwritten with the .icbu file.
    I presume that you do not want to do that.
    One method of accomplishing the integration without losing current data, is to use iCal>File>Export>Export... for each one of your current calendars. That method will create .ics files for the individual calendars. After creating those .ics files and saving them to a suitable location, you can then use the .icbu file to restore from the archive.
    After the archive restoration is complete, you can go to the saved location and double click on the .ics files. You will be offered a choice to create a new calendar, or integrate into an existing calendar. Use the choice appropriate for your situation.

  • Disable all the previous dates in a calendar form

    hi guys,
    I am having a calendar form in which it displays all the previous,current,future dates and months.when i click on the particular button on the
    calendar it dispalys the date, month, and year.its working fine.But what i need is, i want to disable all the previous dates in the calendar till the current
    date.But not to disable the previous button.
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    class CalendarForm extends JFrame
    JButton[] btn = new JButton[49];
    int month = java.util.Calendar.getInstance().get(java.util.Calendar.MONTH);
    int year = java.util.Calendar.getInstance().get(java.util.Calendar.YEAR);
    JLabel lbl = new JLabel("", JLabel.CENTER);
    JTextField tf1=new JTextField();
    public CalendarForm()
    buildGUI();
    setDates();
    public void buildGUI()
    setLocation(200,350);
    setDefaultCloseOperation(HIDE_ON_CLOSE);
    String[] header = {"Sun","Mon","Tue","Wed","Thur","Fri","Sat"};
    JPanel midPanel = new JPanel(new GridLayout(7,7));
    midPanel.setPreferredSize(new Dimension(350,250));
    for(int x = 0; x < btn.length; x++)
    final int selection = x;
    btn[x] = new JButton();
    btn[x].setFocusPainted(false);
    if(x>6)
    btn[x].addActionListener(new ActionListener(){
    public void actionPerformed(ActionEvent ae){
    displayDatePicked(btn[selection].getActionCommand());}});
    if(x < 7)
    {btn[x].setFont(new Font("Lucida", Font.PLAIN, 8)); btn[x].setText(header[x]);}
    midPanel.add(btn[x]);
    JPanel lowPanel = new JPanel(new GridLayout(1,3));
    JButton prevBtn = new JButton("<< Previous");
    prevBtn.addActionListener(new ActionListener(){
    public void actionPerformed(ActionEvent ae){
    month--;setDates();}});
    lowPanel.add(prevBtn);
    lowPanel.add(lbl);
    JButton nextBtn = new JButton("Next >>");
    nextBtn.addActionListener(new ActionListener(){
    public void actionPerformed(ActionEvent ae){
    month++;setDates();}});
    lowPanel.add(nextBtn);
    getContentPane().add(midPanel,BorderLayout.CENTER);
    getContentPane().add(lowPanel,BorderLayout.SOUTH);
    pack();
    public void setDates()
    for(int x = 7; x < btn.length; x++) btn[x].setText("");
    java.text.SimpleDateFormat sdf = new java.text.SimpleDateFormat("MMMM yyyy");
    java.util.Calendar cal = java.util.Calendar.getInstance();
    cal.set(year,month,1);
    int dayOfWeek = cal.get(java.util.Calendar.DAY_OF_WEEK);
    int daysInMonth = cal.getActualMaximum(java.util.Calendar.DAY_OF_MONTH);
    for(int x = 6+dayOfWeek,day = 1; day <= daysInMonth; x++,day++) btn[x].setText(""+day);
    lbl.setText(sdf.format(cal.getTime()));
    setTitle("Calendar - "+lbl.getText());
    public void displayDatePicked(String day)
    if(day.equals("") == false)
    // java.text.SimpleDateFormat sdf = new java.text.SimpleDateFormat("EEEE d MMMM, yyyy");
    java.text.SimpleDateFormat sdf = new java.text.SimpleDateFormat("dd/MM/yyyy");
    java.util.Calendar cal = java.util.Calendar.getInstance();
    cal.set(year,month,Integer.parseInt(day));
    System.out.println(tf1.getText());
    getContentPane().add(tf1,BorderLayout.NORTH);
    // JOptionPane.showMessageDialog(this,"You picked "+sdf.format(cal.getTime()));
    tf1.setText(sdf.format(cal.getTime()));
    System.out.println("from date"+tf1.getText());
    this.setVisible(false);
    public String getFromDate()
    return tf1.getText();
    public static void main(String[] args)
         new CalendarForm().setVisible(true);
    the above  code is to diaplay the calendar form.plzzzzzzzzzzzzzzzz help me. thanks in advance                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    hi michael,i disabled all the previous buttons in a calendar form.this is my code
    import java.awt.*;
    import java.awt.event.*;
    import java.text.DateFormat;
    import java.text.ParseException;
    import java.util.Date;
    import java.util.logging.Level;
    import java.util.logging.Logger;
    import javax.swing.*;
    class CalendarForm extends JFrame {
        JButton[] btn = new JButton[49];
        int month = java.util.Calendar.getInstance().get(java.util.Calendar.MONTH);
        int date = java.util.Calendar.getInstance().get(java.util.Calendar.DATE);
        int year = java.util.Calendar.getInstance().get(java.util.Calendar.YEAR);
        JLabel lbl = new JLabel("", JLabel.CENTER);
        JTextField tf1 = new JTextField();
        public CalendarForm() {
            buildGUI();
            setDates();
        private String getMonthAndYearAsString() {
            java.text.SimpleDateFormat sdf = new java.text.SimpleDateFormat("MMMM yyyy");
            return sdf.format(new Date(System.currentTimeMillis()));
        private Date getCurrentDate() {
            java.text.SimpleDateFormat sdf = new java.text.SimpleDateFormat("dd MM yyyy");
            return new Date();
        public void buildGUI() {
            setLocation(450, 350);
            setDefaultCloseOperation(HIDE_ON_CLOSE);
            String[] header = {"Sun", "Mon", "Tue", "Wed", "Thur", "Fri", "Sat"};
            JPanel midPanel = new JPanel(new GridLayout(7, 7));
            midPanel.setPreferredSize(new Dimension(350, 250));
            for (int x = 0; x < btn.length; x++) {
                final int selection = x;
                btn[x] = new JButton();
                btn[x].setFocusPainted(false);
                if (x > 6) {
                    btn[x].addActionListener(new ActionListener() {
                        public void actionPerformed(ActionEvent ae) {
                            displayDatePicked(btn[selection].getActionCommand());
                if (x < 7) {
                    btn[x].setFont(new Font("Lucida", Font.PLAIN, 8));
                    btn[x].setText(header[x]);
                midPanel.add(btn[x]);
            JPanel lowPanel = new JPanel(new GridLayout(1, 3));
            JButton prevBtn = new JButton("<< Previous");
            prevBtn.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent ae) {
                    month--;
                    setDates();
                    java.text.SimpleDateFormat sdf = new java.text.SimpleDateFormat("MMMM yyyy");
                    java.util.Calendar cal = java.util.Calendar.getInstance();
                    cal.set(year, month, 1);
                    int dayOfWeek = cal.get(java.util.Calendar.DAY_OF_WEEK);
                    int daysInMonth = cal.getActualMaximum(java.util.Calendar.DAY_OF_MONTH);
                    String currentMonth = getMonthAndYearAsString();
                    System.out.println("CURRENT MONTH AND YEAR " + currentMonth);
                    String selectedMonth = sdf.format(cal.getTime());
                    System.out.println("SELECTED MONTH AND YEAR " + selectedMonth);
                    Date currentDate = getCurrentDate();
                    Date selectedDate = new Date(cal.getTimeInMillis());
                    //Comparing currentDate nad selectedDate
                    int off = currentDate.compareTo(selectedDate);
                    int currentDay = date;
                    if (currentMonth.compareTo(selectedMonth) == 0) {
                        for (int x = 7 + dayOfWeek,  day = 1; day <= btn.length; x++, day++) {
                            btn[x].setEnabled(true);
                            if (day < currentDay) {
                                int k = x - 1;
                                for (int j = 7; j <= k; j++) {
                                    btn[j].setEnabled(false);
                    } else if (off == 1) {
                        for (int x = 6 + dayOfWeek,  day = 1; day < daysInMonth; x++, day++) {
                            for (int i = 6 + dayOfWeek; day < currentDay; i++) {
                                btn.setEnabled(false);
    } else if (off == -1) {
    for (int x = 7, day = 1; day < btn.length; x++, day++) {
    btn[x].setEnabled(true);
    lowPanel.add(prevBtn);
    lowPanel.add(lbl);
    JButton nextBtn = new JButton("Next >>");
    nextBtn.addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent ae) {
    month++;
    setDates();
    java.text.SimpleDateFormat sdf = new java.text.SimpleDateFormat("MMMM yyyy");
    java.util.Calendar cal = java.util.Calendar.getInstance();
    cal.set(year, month, 1);
    int dayOfWeek = cal.get(java.util.Calendar.DAY_OF_WEEK);
    int daysInMonth = cal.getActualMaximum(java.util.Calendar.DAY_OF_MONTH);
    String currentMonth = getMonthAndYearAsString();
    System.out.println("CURRENT MONTH AND YEAR " + currentMonth);
    String selectedMonth = sdf.format(cal.getTime());
    System.out.println("SELECTED MONTH AND YEAR " + selectedMonth);
    Date currentDate = getCurrentDate();
    Date selectedDate = new Date(cal.getTimeInMillis());
    //Comparing currentDate and selectedDate
    int off = currentDate.compareTo(selectedDate);
    int currentDay = date;
    if (currentMonth.compareTo(selectedMonth) == 0) {
    for (int x = 7 + dayOfWeek, day = 1; day <= btn.length; x++, day++) {
    btn[x].setEnabled(true);
    if (day < currentDay) {
    int k = x - 1;
    for (int j = 7; j <= k; j++) {
    btn[j].setEnabled(false);
    if (off == -1) {
    for (int x = 7, day = 1; day < btn.length; x++, day++) {
    btn[x].setEnabled(true);
    } else if (off == 1) {
    for (int x = 6 + dayOfWeek, day = 1; day < daysInMonth; x++, day++) {
    for (int i = 6 + dayOfWeek; day < currentDay; i++) {
    btn[i].setEnabled(false);
    lowPanel.add(nextBtn);
    getContentPane().add(midPanel, BorderLayout.CENTER);
    getContentPane().add(lowPanel, BorderLayout.SOUTH);
    pack();
    public void setDates() {
    for (int x = 7; x < btn.length; x++) {
    btn[x].setText("");
    java.text.SimpleDateFormat sdf = new java.text.SimpleDateFormat("MMMM yyyy");
    java.util.Calendar cal = java.util.Calendar.getInstance();
    cal.set(year, month, 1);
    int dayOfWeek = cal.get(java.util.Calendar.DAY_OF_WEEK);
    int daysInMonth = cal.getActualMaximum(java.util.Calendar.DAY_OF_MONTH);
    lbl.setText(sdf.format(cal.getTime()));
    setTitle("Calendar - " + lbl.getText());
    int currentDay = date;
    for (int x = 6 + dayOfWeek, day = 1; day <= daysInMonth; x++, day++) {
    btn[x].setText("" + day);
    if (day < currentDay) {
    for (int j = 7; j <= x; j++) {
    btn[j].setEnabled(false);
    public void displayDatePicked(String day) {
    if (day.equals("") == false) {
    java.text.SimpleDateFormat sdf = new java.text.SimpleDateFormat("dd/MM/yyyy");
    java.util.Calendar cal = java.util.Calendar.getInstance();
    cal.set(year, month, Integer.parseInt(day));
    System.out.println(month);
    System.out.println(tf1.getText());
    tf1.setText(sdf.format(cal.getTime()));
    System.out.println("from date" + tf1.getText());
    // VStudentAttendanceForm class ....
    if (VStudentAttendanceForm.jcalFlag == 1) {
    VStudentAttendanceForm.jtfFromDate.setText(tf1.getText());
    if (VStudentAttendanceForm.jcalFlag == 2) {
    VStudentAttendanceForm.jtfToDate.setText(tf1.getText());
    if (ManageStudents.cal == 1) {
    ManageStudents.jTextField22.setText(tf1.getText());
    ManageStudents.FromjTextField10.setText(tf1.getText());
    if (ManageStudents.cal == 2) {
    ManageStudents.jTextField23.setText(tf1.getText());
    ManageStudents.TojTextField11.setText(tf1.getText());
    if (vAuditTrail.cal == 1) {
    vAuditTrail.jTextField3.setText(tf1.getText());
    if (vAuditTrail.cal == 2) {
    vAuditTrail.jTextField4.setText(tf1.getText());
    if (Attendance.cal == 1) {
    Attendance.jTextField7.setText(tf1.getText());
    if (Attendance.cal == 2) {
    Attendance.jTextField8.setText(tf1.getText());
    this.setVisible(false);
    public String getFromDate() {
    return tf1.getText();
    public static void main(String[] args) {
    new CalendarForm().setVisible(true);

  • Calendar Tile on Windows 8.1 displaying incorrect date for icloud calendar but date icon displays correct date on iPhone 5 and iPad Air

    Calendar Tile on Windows 8.1 displaying incorrect date for icloud calendar but date icon displays correct date on iPhone 5 and iPad Air.  Date on Windows 8.1 is correct.  Thank you.

    Try doing  a reset on your phone. Sounds like your carrier's time set is not getting through to your device. If the reset doesn't do it, then go to Settings>General>Reset>Reset Network Settings. That should do it.

  • Can I recover lost data from my calendar?

    I have an iPhone 4S and had been using the calendar. When I recently purchased an iPad2 Wi-Fi, i lost years worth of data from my calendar when I attempted to sync the two using iCloud. The data is not on either the iPhone or iPad and I'm wondering if there is any way I can recover this?

    Check iTunes via sync to see if you have a previous backup of your iPhone that you know contained the calendar data.  You can restore your iPad from an iPhone backup.  Just do it in iTunes on your computer.

Maybe you are looking for

  • What cable do I need to plug airport extreme into my phone line?

    basically at the moment I have what I think is a DSL cable, its like a small Ethernet cable.. And I have DSL filter...

  • $userscripts not working in Photoshop ME

    It seems like $userscripts doesn't resolve to the startup scripts directory on Photoshop ME. Any idea why? This is a screenshot one of my users sent me.

  • E2000 won't connect to laptop using Easy Setup Key

    Running Win7. When trying to connect Lenovo laptop to E2000 with Easy Setup Key, the progress bar hangs at 25%. However, the E2000 will connect to the laptop with an Ethernet cable. Same problem on both of my Lenovo G555 laptops. Any ideas?

  • Site definition settings on FTP use in Dreamweaver CS4

    I work on a MackBook Pro, Mavericks OS, with Dreamweaver CS4. In filling in my settings in Site Definition dialog for local site and remote site, sometimes doing a Test I get the message that I am connected, but when I try to upload through Put arrow

  • Reading attachment: diposition NULL

    Hi, I am trying to read attachment using javamail but when I use getDisposition function, I always get NULL disposition value,even for attachment.Please help me.This is the code I am using. import java.io.*; import javax.swing.*; import java.util.*;