Examples of DateFormat


Examples of java.text.DateFormat

    if (tStartTime != null) {
      Calendar calendarStart = Calendar.getInstance();
      calendarStart.setTime(tStartTime);
      startHrs = calendarStart.get(Calendar.HOUR_OF_DAY);
      startMins = calendarStart.get(Calendar.MINUTE);
      DateFormat df= new SimpleDateFormat("h:mm a");
      form.set("detailStartTime",(df.format(tStartTime)).toString());
    }
   
    if (tEndTime != null) {
      Calendar calendarEnd = Calendar.getInstance();
      calendarEnd.setTime(tEndTime);
      endHrs = calendarEnd.get(Calendar.HOUR_OF_DAY);
      endMins = calendarEnd.get(Calendar.MINUTE);
      DateFormat df= new SimpleDateFormat("h:mm a");
      form.set("detailEndTime",( df.format(tEndTime)).toString());
    }
    return form;
  }
View Full Code Here

Examples of java.text.DateFormat

            CvFileVO flvo = new CvFileVO();
            flvo.setTitle(strf); //file name

            Calendar c = Calendar.getInstance();
            java.util.Date dt = c.getTime();
            DateFormat df = new SimpleDateFormat("MM_dd_yyyy_hh_mm_ss");
            String dateStamp = df.format(dt);

            strf = "attachment_" + dateStamp +"_"+ strf;
            flvo.setName(strf);
            flvo.setCreatedBy(userid);
            flvo.setOwner(userid);
View Full Code Here

Examples of java.text.DateFormat

        CvFileVO flvo = new CvFileVO();
        flvo.setTitle(strf); //file name

    Calendar c = Calendar.getInstance();
    java.util.Date dt = c.getTime();
    DateFormat df = new SimpleDateFormat("MM_dd_yyyy_hh_mm_ss");
    String dateStamp = df.format(dt);

    strf = "attachment_" + dateStamp +"_"+ strf;
        flvo.setName(strf);
        flvo.setCreatedBy(userid);
        flvo.setOwner(userid);
View Full Code Here

Examples of java.text.DateFormat

      {
        setCreated(ivo.getFirstName()+" " + ivo.getLastName());
        String createdbyname = ivo.getFirstName()+" " + ivo.getLastName();
        arg1.setAttribute("createdbyname", createdbyname);

        DateFormat df = new SimpleDateFormat("dd/MM/yyyy - h:mm a") ;
        String createdon= df.format(oldTaskVO.getCreatedOn());
        arg1.setAttribute("createdon" , createdon);
        arg1.setAttribute("createdby" ,""+oldTaskVO.getCreatedBy());
      }




      ivo = oldTaskVO.getModifiedByVO();
      if (ivo != null)
      {
        setModified(ivo.getFirstName()+" " + ivo.getLastName());
        String modifiedbyname = ivo.getFirstName()+" " + ivo.getLastName();
        arg1.setAttribute("modifiedbyname", modifiedbyname);

        DateFormat df = new SimpleDateFormat("dd/MM/yyyy - h:mm a") ;
        String modified= "";
        if(oldTaskVO.getModifiedOn() != null)
         modified= df.format(oldTaskVO.getModifiedOn());

        arg1.setAttribute("modifiedon" , modified);
        arg1.setAttribute("modifiedby" , ""+oldTaskVO.getModifiedBy());
      }
View Full Code Here

Examples of java.text.DateFormat

        if (workIndividual != null) {
          taskForm.setModified(workIndividual.getFirstName() + " " + workIndividual.getLastName());
        }

        // TODO l10n date.
        DateFormat df = new SimpleDateFormat("dd/MM/yyyy - h:mm a");
        if (taskVO.getModifiedOn() != null) {
          String createdon = df.format(taskVO.getCreatedOn());
          taskForm.setCreatedOn(createdon);
        }
        if (taskVO.getModifiedOn() != null) {
          taskForm.setModifiedOn(df.format(taskVO.getModifiedOn()));
        }

        if (taskVO.getModifiedBy() != 0) {
          taskForm.setModifiedbyid(String.valueOf(taskVO.getModifiedBy()));
        }
View Full Code Here

Examples of java.text.DateFormat

        calendarStart.setTime(tStartTime);

        startHrs = calendarStart.get(Calendar.HOUR_OF_DAY);
        startMins = calendarStart.get(Calendar.MINUTE);

        DateFormat df = new SimpleDateFormat("h:mm a");

        dynaForm.setStartTime((df.format(timeSlipVO.getStart())).toString());
      }

      if (timeSlipVO.getEnd() != null)
      {
        tEndTime = (Time) timeSlipVO.getEnd();

        Calendar calendarEnd = Calendar.getInstance();
        calendarEnd.setTime(tEndTime);

        endHrs = calendarEnd.get(Calendar.HOUR_OF_DAY);
        endMins = calendarEnd.get(Calendar.MINUTE);

        DateFormat df = new SimpleDateFormat("h:mm a");

        dynaForm.setEndTime((df.format(timeSlipVO.getEnd())).toString());
      }

      if (timeSlipVO.getBreakTime() != -1)
      {
        Float BreakTime = new Float(timeSlipVO.getBreakTime());
View Full Code Here

Examples of java.text.DateFormat

      // This value will display the selected month in the mini calendar.
      GregorianCalendar selectedDate = new GregorianCalendar(year.intValue(), month.intValue() - 1, 1);
      dateForm.set("selectedDate", selectedDate);
      request.setAttribute("selectedDate", selectedDate);

      DateFormat df = DateFormat.getDateInstance(DateFormat.SHORT, locale);
      // simple mode basicall is non-calendar/activities mode, because
      // the following behaviour is unexpected in sales.
      boolean simpleMode = ((Boolean)dateForm.get("simpleMode")).booleanValue();
      String startDate = (String) dateForm.get("startDate");
      String endDate = (String) dateForm.get("endDate");
      if (!simpleMode) {
        if ((startDate == null || startDate.length() < 1) && (endDate == null || endDate.length() < 1)) {
          // if startDate *AND* endDate are not already set, then
          // set them both to the current date in the format MM/dd/yyyy
          startDate = df.format(currentDate.getTime());
          endDate = startDate;
        }
      }
      dateForm.set("startDate", startDate);
      dateForm.set("endDate", endDate);

      // if startTime is given, but endTime is NOT, then set the
      // endTime = startTime + 1 hour
      String startTime = (String) dateForm.get("startTime");
      String endTime = (String) dateForm.get("endTime");
      if ((startTime != null && startTime.length() > 0) && (endTime == null || endTime.length() <= 0)) {
        DateFormat tf = DateFormat.getTimeInstance(DateFormat.SHORT, locale);
        GregorianCalendar endTimeCal = new GregorianCalendar();
        // get a Calendar object generated from the given startTime String
        endTimeCal.setTime(tf.parse(startTime));
        // add one hour to the Calendar object
        endTimeCal.set(GregorianCalendar.HOUR_OF_DAY, endTimeCal.get(GregorianCalendar.HOUR_OF_DAY) + 1);
        // get the String representation of the Calendar object, using the
        // SimpleDateFormat
        String defaultEndTime = tf.format(endTimeCal.getTime());
        // set the new endTime String to the form
        dateForm.set("endTime", defaultEndTime);
      }
    } catch (Exception e) {
      logger.error("[execute]: Exception", e);
View Full Code Here

Examples of java.text.DateFormat

      Calendar calendarStart = Calendar.getInstance();
      calendarStart.setTime(tvo.getStart());

      int startHrs = calendarStart.get(Calendar.HOUR_OF_DAY);
      int startMins = calendarStart.get(Calendar.MINUTE);
      DateFormat df = new SimpleDateFormat("h:mm a");

      tsForm.setStartTime((df.format(tvo.getStart())).toString());

      Calendar calendarEnd = Calendar.getInstance();
      calendarEnd.setTime(tvo.getEnd());

      int endHrs = calendarEnd.get(Calendar.HOUR_OF_DAY);
      int endMins = calendarEnd.get(Calendar.MINUTE);
      tsForm.setEndTime((df.format(tvo.getEnd())).toString());

      Float BreakTime = new Float(tvo.getBreakTime());
      int iHours = BreakTime.intValue();
      float breakTime = (BreakTime.floatValue() - iHours) * 60;
      Float Mins = new Float(breakTime);
View Full Code Here

Examples of java.text.DateFormat

      String oldName = flvo.getName();

      Calendar c = Calendar.getInstance();
      java.util.Date dt = c.getTime();
      DateFormat df = new SimpleDateFormat("MM_dd_yyyy_hh_mm_ss");
      String dateStamp = df.format(dt);

      // String newName = fileId + "_" + flvo.getTitle();

      String newName = "attachment_" + dateStamp + "_" + flvo.getTitle();
View Full Code Here

Examples of java.text.DateFormat

          CvFolderVO homeFld = remoteFile.getHomeFolder(indvID);

          int rn = (new Random()).nextInt();
          Calendar c = Calendar.getInstance();
          java.util.Date dt = c.getTime();
          DateFormat df = new SimpleDateFormat("MM_dd_yyyy");
          String dateStamp = df.format(dt);

          CvFileVO flvo = new CvFileVO();
          flvo.setTitle("Error Log");
          flvo.setName("errorLog_" + indvID + "_" + rn + "_" + dateStamp + ".txt");
          messageList.put("fileName","errorLog_" + indvID + "_" + rn + "_" + dateStamp + ".txt");
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.