Help with date validation on input boxes.

I need some help with date validation on input boxes.
What I�m trying to create is a form where a user inputs dates and then the rest of the form calculates the other dates for them.
i.e. � A user inputs 2 dates (A & B) and then a 3rd date which is 11 weeks before date B is calculated automatically.
Is this possible and if so how do I do it ???
Thanks

Hi,
to get third date try this:
java.util.Date bDate = ...;
Calendar yourCalendar = new GregorianCalendar();
yourCalendar.setTime(bDate);
yourCalendar.roll(Calendar.WEEK_OF_YEAR, -11);
java.util.Date cDate = yourCalendar.getTime();Regards
Ldinka

Similar Messages

  • The timesheet creation failed, because of problems with the project I server or with data validation

    Hi,
    One of my user is facing issue in creating new time sheet,
    "The time sheet creation failed, because of problems with the project server or with data validations".
    This issue is coming to only few members out of 10000 members.
    Note: For the same user, can able to do in other machines. only the problem in his machine. Have ran the office diagnostics, but still the problem persists.
    Is any add-on's/any settings need to update in IE. Could any one please help me on how to fix this issue?
    Many thanks in advance.

    I would check the compatibility settings in IE etc, or try another browser (chrome, safari etc.)
    Ben Howard [MVP] | web |
    blog | book

  • Is there a Java utility class to help with data management in a desktop UI?

    Is there a Java utility class to help with data management in a desktop UI?
    I am writing a UI to configure a network device that will be connected to the serial port of the computer while it is being configured. There is no web server or database for my application. The UI has a large number of fields (50+) spread across 16 tabs. I will write the UI in Java FX. It should run inside the browser when launched, and issue commands to the network device through the serial port. A UI has several input fields spread across tabs and one single Submit button. If a field is edited, and the submit button clicked, it issues a command and sends the new datum to the device, retrieves current value and any errors. so if input field has bad data, it is indicated for example, the field has a red border.
    Is there a standard design pattern or Java utility class to accomplish the frequently encountered, 'generic' parts of this scenario? lazy loading, submitting only what fields changed, displaying what fields have errors etc. (I dont want to reinvent the wheel if it is already there). Otherwise I can write such a class and share it back here if it is useful.
    someone recommended JGoodies Bindings for Swing - will this work well and in FX?

    Many thanks for the reply.
    In the servlet create an Arraylist and in th efor
    loop put the insances of the csqabean in this
    ArrayList. Exit the for loop and then add the
    ArrayList as an attribute to the session.I am making the use of Vector and did the same thing as u mentioned.I am using scriplets...
    >
    In the jsp retrieve the array list from the session
    and in a for loop step through the ArrayList
    retrieving each CourseSectionQABean and displaying.
    You can do this in a scriptlet but should also check
    out the jstl tags.I am able to remove this problem.Thanks again for the suggestion.
    AS

  • Need help in date Validation Urgent

    Hi ,
    We need help in Date Validation.
    we have 2 Date fields on the form Start Date, End Date
    The requirement is: End Date (May not be greater than 30 years from the start date).
    I have written following script on End Date Exit event. But the problem is its calculating 30 years from the Current Date not from the Start Date
    var tDate = util.scand("mm/dd/yyyy", new Date());
    var M = tDate.getMonth();
    var D = tDate.getDate();
    var Y = tDate.getFullYear();
    var SRes = util.printd("yyyy-mm-dd", new Date((Y+30), M,D) );
    //app.alert(SRes)if (SRes <= this.rawValue){
    app.alert("May not be greater than 30 years from the start date")
    xfa.host.setFocus(
    this);}
    can someone please help me
    Regards,
    Jay

    Hi,
    You'll need to get javascript date from LCD field, and calculate & compare with the future date in javascript date.
    try following script;
    var sDate = StartDate.rawValue;
    var wkStartDate = util.scand("yyyy-mm-dd", sDate);
    var nYear = wkStartDate.getFullYear();
    var nMonth = wkStartDate.getMonth();
    var nDay = wkStartDate.getDate();
    var wkFutureDate = new Date(nYear  + 30 , nMonth, nDay);
    sDate = EndDate.rawValue;
    var wkEndDate = util.scand("yyyy-mm-dd", sDate);
    if (wkEndDate.getTime() > wkFutureDate.getTime()){
      xfa.host.messageBox("May not be greater than 30 years from the start date");
      xfa.host.setFocus(this);

  • Need Help with data type conversion

    Hello People,
    I am new to java, i need some help with data type conversion:
    I have variable(string) storing IP Address
    IPAddr="10.10.103.10"
    I have to call a library function which passes IP Address and does something and returns me a value.
    The problem I have is that external function call in this library excepts IP Address in form of a byte array.
    Here is the syntax for the function I am calling through my program
    int createDevice (byte[] ipAddress).
    now my problem is I don't know how to convert the string  IPAddr variable into a byte[] ipAddress to pass it through method.

    Class InetAddress has a method
    byte[]      getAddress() You can create an instance using the static method getByName() providing the IP address string as argument.

  • Need Help with Dates

    I am printing a calendar and certain events will be helds on certain dates.
    One can edit the event if it has not passed the date. Events in the past can be viewed but not edited.
    When I query the database the date must be formatted dd-MMM-yy
    I am able to get today's date by doing this:
    java.util.Date today = new java.util.Date();
    String formatString = "dd-MMM-yy";
    SimpleDateFormat sdf = new SimpleDateFormat(formatString);
    String today_str = sdf.format(today);
    My code for printing the calendar: I left out some of the table formatting in the JSP page.
    GregorianCalendar d = new GregorianCalendar();
    int today = d.get(Calendar.DAY_OF_MONTH);
    int month = d.get(Calendar.MONTH);
    d.set(Calendar.DAY_OF_MONTH,1);
    int weekday = d.get(Calendar.DAY_OF_WEEK);
    for(int i = Calendar.SUNDAY; i < weekday; i++)
    out.print("<td> </td>");
    do {
    int day = d.get(Calendar.DAY_OF_MONTH);
    out.print("<td>" + day + "</td>");
    String formatString = "dd-MMM-yy";
    SimpleDateFormat sdf = new SimpleDateFormat(formatString);
    //if(event exists on this day
    // Get results
    // print link for viewing
    // if (after today) print link for edit
    if(weekday == Calendar.SATURDAY)
    out.println("</tr><tr valign=top>");
    d.add(Calendar.DAY_OF_MONTH,1);
    weekday = d.get(Calendar.DAY_OF_WEEK);
    } while(d.get(Calendar.MONTH) == month);
    if(weekday != Calendar.SUNDAY)
    System.out.println();
    The part I need help on is this:
    //if(event exists on this day
    // Get results
    // print link for viewing
    // if (after today) print link for edit
    I'm looping through each day of the month to print the days. I have the month, day, year as integers. How can I create a date object out of that and compare it to today's date to test if it's before or after today???
    All the function in the Date class that I think would do this have been deprecated.

    Need Help with Dates
    Here is some information about dates:
    There are many edible palm fruits, and one of the most widespread and favored of these is the data (Phoenix dactylifera). Dates were cultivated in ancient land from Mesopotamia to prehistoric Egypt, possibly as early as 6000 B.C. Then--as now--dates were a staple for the natives of those dry regions. Much later, Arabs spread dates around northern Africa, and dates were introduced into California by the Spaniards in 1765, around Mission San Ignacio.
    The date prefers dry, hot climates, because date fruits are injured at temperatures of 20 degrees F, and the damp climate of the California coast was not favorable for fruit production. In the mid-1800s, the date industry developed in California's hot interior valleys and in Arizona. Now the date industry in the United States is localized mostly in the Coachella Valley, where the sandy soils permit the plants to be deeply irrigated. Today the new varieties, mostly introduced in this century, produce about 40 million pounds of dates per annum, or over 60% of the dates consumed in this country. The rest are imported mainly from Persia. According to one survey, about one million people are engaged entirely in date palm cultivation worldwide.
    Hope that helps.

  • Help with date code

    Sry about this amount of code lines.... but i realy need help...
    I must insert into a table, the date, like 10/12/2009, and the time, like 22:34:12... but, when i select the date from a datepicker, and insert the time into a text field... i got this result:
    if the date inserted was 12/12/2009 and the time 22:34:12
    result is.......................12/12/0922 34:12:00 <<<<< it´s getting just the two lasts number of the year and inserting the two firsts number of the time into the year, like year 0922 ....
    I´m using a javascript source to create a datepicker......
    and that is the procedure to insert into the table.......
    PROCEDURE set_atendimento(
    p_id_chamado_atendimento IN chamado_atendimento.id_chamado_atendimento%TYPE,
    p_id_chamado IN chamado_atendimento.id_chamado%TYPE,
    p_informacao IN chamado_atendimento.informacao%TYPE,
    p_datahora_inicio IN chamado_atendimento.datahora_inicio%TYPE,
    p_datahora_fim IN chamado_atendimento.datahora_fim%TYPE,
    p_hora_inicio IN VARCHAR2,
    p_hora_fim IN VARCHAR2
    IS
    v_inicio DATE;
    v_fim DATE;
    BEGIN
    v_inicio := TO_DATE(TO_CHAR(p_datahora_inicio || p_hora_inicio), 'DD/MM/YYYY HH24:MI:SS');
    v_fim := TO_DATE(TO_CHAR(p_datahora_fim || p_hora_fim), 'DD/MM/YYYY HH24:MI:SS');
    UPDATE
    chamado_atendimento
    SET
    informacao = UPPER(p_informacao)
    WHERE
    id_chamado_atendimento = p_id_chamado_atendimento;
    IF SQL%NOTFOUND THEN
    INSERT INTO
    chamado_atendimento
    (id_chamado_atendimento, id_chamado, id_operador, datahora_inicio, datahora_fim, informacao)
    VALUES
    (SEQ_CHAMADO_ATENDIMENTO.nextval, p_id_chamado, pkg_operador.get_id_operador, v_inicio, v_fim, UPPER(p_informacao));
    END IF;
    END;
    that is the JAVASCRIPT
    <script language="JavaScript" type="text/JavaScript">
    $(function(){
    $.datepicker.setDefaults({
    showOn: 'button',
    buttonImage: '/i/themes/fwsac/includes/jquery/images/calendario.gif',
    buttonImageOnly: true,
    closeText: 'Fechar',
    prevText: '<Anterior',
    nextText: 'Pr&oacute;ximo>',
    currentText: 'Hoje',
    monthNames: ['Janeiro','Fevereiro','Mar&ccedil;o','Abril','Maio','Junho','Julho','Agosto','Setembro','Outubro','Novembro','Dezembro'],
    monthNamesShort: ['Jan','Fev','Mar','Abr','Mai','Jun','Jul','Ago','Set','Out','Nov','Dez'],
    dayNames: ['Domingo','Segunda-feira','Ter&ccedil;a-feira','Quarta-feira','Quinta-feira','Sexta-feira','Sabado'],
    dayNamesShort: ['Dom','Seg','Ter','Qua','Qui','Sex','Sab'],
    dayNamesMin: ['Dom','Seg','Ter','Qua','Qui','Sex','Sab'],
    dateFormat: 'dd/mm/yy',
    firstDay: 0,
    isRTL: false,
    showAnim: 'slide'
    $('#P5004_DATAHORA_INICIO , #P5004_DATAHORA_FIM').datepicker({ beforeShow: fdateRange });
    function fdateRange(input){
    return {
    minDate: (input.id == "P5004_DATAHORA_FIM" ? $("#P5004_DATAHORA_INICIO").datepicker("getDate") : null),
    maxDate: (input.id == "P5004_DATAHORA_INICIO" ? $("#P5004_DATAHORA_FIM").datepicker("getDate") : null)
    </script>
    what i must change to get the 4 numbers of the year and all numbers of the time and conca " || " with the date??
    can someone help with this, pls??

    Hello brugo,
    Try this:
    v_inicio := to_nchar((to_date(p_datahora_inicio || p_hora_inicio , 'DD/MM/YYYY HH24:MI:SS')), 'DD/MM/YYYY HH24:MI:SS');
    v_inicio := to_nchar((to_date(p_datahora_fim || p_hora_fim , 'DD/MM/YYYY HH24:MI:SS')), 'DD/MM/YYYY HH24:MI:SS');When I substitute strings: '10/12/2009' for p_datahora_inicio and '22:30:05' for p_hora_inicio, using this format string, I get: 10/12/2009 22:30:05 as a result.
    Don.
    You can reward this reply by marking it as either Helpful or Correct :)

  • Problems with date validation pattern DD.MM.YYYY in Form Builder

    (I am using LiveCycle Designer 8.0.)
    My form uses an input date field which consistst of DD.MM.YYYY.
    Display pattern, edit pattern, validation pattern and date pattern has been set to DD.MM.YYYY.
    "Validation Pattern Message"-box has been set to checked.
    "Validation Script Message"-box is not checked.
    1. When I type:      313101
    the system converts the digits to the date 01.01.3131
    2. When I type:      3131
    the system converts the digits to the date 01.01.3131
    3. When I type:       31   
    I get an error message "Date is not valid."
    I need a form to throw an error message if the user doesn`t type the correct input
    DD.MM.YYYY.  (01.03.2009)
    Thanks in advance.
    Tor

    Does anyone have any input on this matter?
    Thanks in advance.
    Regards,
    Tor

  • Help with data load model

    Hi,
    I need help with a data load model. First, i'm doing delta extraction from R/3, we load data with a InfoSource to InfoCube A and InfoCube B.
    I'm doing master data validation on the load, so if a load fails for InfoCube A, it fails for InfoCube B too (this is because i can have only 1 InfoPackage for the 2 infocubes, because of the delta update).
    So i propose a new model in wich:
    - The delta load is taked first to an ODS.
    - ODS is cleaned before the delta update.
    - Then i create 2 InfoPackages for full load from ODS to  Infocube A, and from ODS to InfoCube B.
    With this solution i can have 2 infopackages from ODS because i'm not doing a delta load from here to the cubes, and with 2 infopackages i can have independent validations for each cube so if one of them fails, the other can still be loaded sucessfully.
    The solution fails because if i load delta from R/3 to the ODS i can't clean it first. The initialization and the old updates needs to be previuslly loaded on the ODS. Then i can't do full load to the cubes and neither have 2 infopackages.
    Please help me to solve this issue.
    thanks a lot

    Hi jeremy,
    what about this simple solution:
    load data by delta from R/3 in your ODS. You can also have an ODS/cube for the historical data which is more space-saving than holding all the old data in PSA. Then you load your historical data from PSA into the historical ODS/cube.
    From your ODS with the actual data you update your requests by full from ODS into the cubes with 2 different full infopackages. But because you load by full you have to use deletion selections in the infopackages to avoid duplicate data!
    regards,
    Jürgen

  • Date Validator in Input Processor

    Hi, I would like to validate a date in a Input Processor, but I don't find a validator
    like "STRING_VALIDTOR", "EMAIL_VALIDATOR" or "PHONE_VALIDATOR", etc...
    Does any one have any idea.
    Thanks Ben.

    Hi
    I dont think this is available out of the box, but it is pretty easy to write
    your own
    check the samples(a custom validator is included)
    You can also use regular expressions (a regex validator does ship out of the box).
    search the net for a regex that represents a date.
    (e.g. http://www.regxlib.com/REDetails.aspx?regexp_id=369)
    I think in portal 4.0 the regex classes were missing, dunno if this has been
    fixed in later versions
    regards
    deepak
    "Ben" <[email protected]> wrote:
    >
    Hi, I would like to validate a date in a Input Processor, but I don't
    find a validator
    like "STRING_VALIDTOR", "EMAIL_VALIDATOR" or "PHONE_VALIDATOR", etc...
    Does any one have any idea.
    Thanks Ben.

  • Time Machine slow backup with Date Validation error?

    Console is spitting out this garbage and I don't know what it means
    Dec 24 01:17:46 Macbook-Pro mdworker[7772]: Date validation error: EXDATE = '20080626T150000,20080807T150000,20080814T150000'
    Dec 24 01:17:48 Macbook-Pro mdworker[7772]: Date validation error: EXDATE = '20071022T150000,20081027T150000'
    Dec 24 01:17:48 Macbook-Pro mdworker[7772]: Date validation error: EXDATE = '20080527T130000,20081028T130000'
    It creeps along and eventually finishes but if I have a lot of data to backup it takes hours for a few hundred MB. Any ideas?
    I've tried starting from scratch and have repaired permissions on my MBP with no luck.
    Message was edited by: jgoettel

    mdworker relates to Spotlight. Check this thread to see if it helps:
    http://discussions.apple.com/thread.jspa?messageID=8372393&#8372393

  • Issue with data Validation while migrating from one application to another

    Hi All,
    I am having a strange issue Kindly please help me .
    I have a data form which have data validation on each cell.The dataform is quite large and contain data for 4 accounts and year (Jan to Dec) combination .The issue is that I when I migrate this data form to other application which is just the replica of the main application. The validation on each cells changes its reference points.
    I have 5 more similar data form and I need to migrate then to other application and also on production sever. Is there any way that while exporting and importing them using formutil.cmd or other way that the validation cells reference does not change its reference point.
    For ex I have validation on Cell A5,A6..........AA6 after migrating it changes to A1,A1.........AA1.
    I am using 11.1.2.1.0 version of Hyperion Planning
    Kindly please help.
    Thanks in advance
    Vikash
    Edited by: user11391767 on Nov 30, 2011 10:47 AM

    Hi Mehmet,
    I tried using the FormDefUtil.cmd .But by using this the reference points of validation changes to first cell when imported.
    Thanks
    Vikash

  • Need some help with date

    Hi everyone!
    I have an application in Flex AIR and I'm having problems with dates, I could't found an example on internet until now.
    I tried this for insert (database is embeded sqlite)
    insertManager.parameters[":mydate"] = mydate.selectedDate.time; // type of this column is INTEGER (in my table) and store a number (milliseconds from 1/1/1970) ex: 1265079600000
    Then when I need read records
    mydate.selectedDate = new Date(mydateprice); //it supposed show me DD/MM/YYYY but in every case display 1/1/1970
    If I replace mydateprice for mydate.selectedDate = new Date(1265079600000); // it brings me the right date
    So I don't know what happed, and I'm not sure if it's the best idea to store a date in Flex AIR
    I'll appreciate any help, information or example to find a solution.
    Regards!
    Mara.-

    Thank you so much VIKASH!!! it works!!!
    Now I'm trying to format this value 1265079600000 in my datagrid column:
    <mx:DateFormatter id="dateFormatter" formatString="DD/MM/YYYY"/>
    <mx:DataGridColumn width="140" textAlign="left" headerText="DATE" dataField="myDateColumn" labelFunction="formatDate"  />
    public function formatDate(item:Object,column:DataGridColumn):String
    return dateFormatter.format(item.myDateColumn);
    but this column appear empty....
    Regards and thanks again!
    Mara.-

  • URGENT HELP WITH DATES

    Hi, I need to compare two dates, so I can get the difference betweem them in hours.

    Try this.. This does it in days but I think you will get the idea..
    import java.io.*;
    import java.util.*;
    import java.text.*;
    public class Ex1805
         public static void main(String[] args)
              SimpleDateFormat sdf = new SimpleDateFormat("d/M/y");
              BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
              String inputDate;
              Date first = new Date(), second = new Date();
              final long MSInDay = 1000 * 60 * 60 * 24;
              boolean valid;
    // input first date
              valid = false;
              while(!valid)
                   try
                   System.out.print("Enter first date: ");
                   inputDate = br.readLine();
                   first = sdf.parse(inputDate);
                   valid = true;
                   catch(ParseException e)
                        System.out.println("Invalid     date. Please enter again.");
                   catch(IOException e)
                        System.out.println("IO Error");
    // input second date
              valid = false;
              while(!valid)
                   try
                   System.out.print("Enter second date: ");
                   inputDate = br.readLine();
                   second = sdf.parse(inputDate);
                   valid = true;
                   catch(ParseException e)
                        System.out.println("Invalid     date. Please enter again.");
                   catch(IOException e)
                        System.out.println("IO Error");
    //     calculate difference in days
              long milliseconds = second.getTime() - first.getTime();
              double doubleDays = (double)milliseconds / MSInDay;
              int days = (int)(doubleDays + 0.5);
              System.out.println("Number of days: " + days);

  • Help with the open/save message box

    Hi everyone, I have a link to a PDF on my website and I need it to open in browser.  Right now it always comes up with the open/save message box.
    This is no good because I need to embed a direct page link (ie #page=9), and the open/save message box removes the page variable and opens to page one.
    It's strange because I have two PDF links on this particular page and while one works fine (and opens in browser) the other constantly prompts with open/ save.
    Suggestions?  I've already gone into the PDF preferences and set it to "Open PDF in Browser"... this does not help.
    Thanks,
    Nathan

    Well - Yes --- and No.  When I try to re-save a document or use the new Save As... implementation I am generally offered my Mac. But - If I create a New document and then use Cmd-S I am taken back to the iCloud Save window with the disclosure triangle closed. I am seeing this in TextEdit and Preview, but I have not checked all my document creator applications to see if the protocol is across the board.)
    (Note  - the "On My Mac" button is only available in the OPEN Dialog - not the SAVE Dialogs.)

Maybe you are looking for