Examples of DateTime


Examples of com.google.gdata.data.DateTime

      oEvnt.setContent(new PlainTextConstruct(oMeet.getStringNull(DB.de_meeting,"")));
   
    When oTimes = new When();
    String sTimeZone = DBCommand.queryStr(oConn, "SELECT "+DB.tx_timezone+" FROM "+DB.k_fellows+" WHERE "+DB.gu_fellow+"='"+oMeet.getString(DB.gu_fellow)+"'");
      if (null==sTimeZone) {
        oTimes.setStartTime(new DateTime(oMeet.getDate(DB.dt_start)));
      oTimes.setEndTime(new DateTime(oMeet.getDate(DB.dt_end)));
      } else {
        int lSign = sTimeZone.charAt(0)=='+' ? 1 : -1;
        String[] aTimeZone = Gadgets.split2(sTimeZone.substring(1),':');
        SimpleTimeZone oTmz = new SimpleTimeZone(lSign*(Integer.parseInt(aTimeZone[0])*3600000+Integer.parseInt(aTimeZone[1])*60000), sTimeZone);
        oTimes.setStartTime(new DateTime(oMeet.getDate(DB.dt_start),oTmz));
      oTimes.setEndTime(new DateTime(oMeet.getDate(DB.dt_end),oTmz));
      }
    oEvnt.addTime(oTimes);
    DBSubset oFlws = oMeet.getFellows(oConn);
    for (int f=0; f<oFlws.getRowCount(); f++) {
      if (!oFlws.isNull(4,f)) {
        EventWho oEwho = new EventWho();
        oEwho.setEmail(oFlws.getString(4,f));
        oEvnt.addParticipant(oEwho);
      } // fi
    } // next
    oEvnt = oCalSrv.insert(postUrl, oEvnt);

    if (!oMeet.isNull(DB.bo_private))
      oEvnt.getVisibility().setValue(oMeet.getShort(DB.bo_private)==0 ? Visibility.PUBLIC_VALUE : Visibility.PRIVATE_VALUE);     
   
    DBCommand.executeUpdate(oConn, "UPDATE "+DB.k_meetings+" SET "+DB.id_icalendar+"='"+oMeet.getString(DB.gu_meeting)+"@hipergate.org"+"' WHERE "+DB.gu_meeting+"='"+oMeet.getString(DB.gu_meeting)+"'");
  } else {
      URL feedUrl = new URL("https://www.google.com/calendar/feeds/default/private/full");
      CalendarQuery myQuery = new CalendarQuery(feedUrl);
      myQuery.setMinimumStartTime(new DateTime(oMeet.getDate(DB.dt_start)));
      myQuery.setMaximumStartTime(new DateTime(oMeet.getDate(DB.dt_end)));

    CalendarEventFeed oFeed = oCalSrv.query(myQuery, CalendarEventFeed.class);   
    for (int i = 0; i < oFeed.getEntries().size(); i++) {
        oEvnt = oFeed.getEntries().get(i);
      if (oEvnt.getIcalUID().equals(oMeet.getString(DB.id_icalendar))) {
        oEvnt.setTitle(new PlainTextConstruct(oMeet.getStringNull(DB.tx_meeting,"")));
          oEvnt.setContent(new PlainTextConstruct(oMeet.getStringNull(DB.de_meeting,"")));
        if (oMeet.isNull(DB.bo_private))
          oEvnt.getVisibility().setValue(Visibility.DEFAULT_VALUE);
        else
          oEvnt.getVisibility().setValue(oMeet.getShort(DB.bo_private)==0 ? Visibility.PUBLIC_VALUE : Visibility.PRIVATE_VALUE);     
        When oTimes = new When();
          oTimes.setStartTime(new DateTime(oMeet.getDate(DB.dt_start)));
        oTimes.setEndTime(new DateTime(oMeet.getDate(DB.dt_end)));
        oEvnt.addTime(oTimes);
        DBSubset oFlws = oMeet.getFellows(oConn);
        for (int f=0; f<oFlws.getRowCount(); f++) {
          if (!oFlws.isNull(4,f)) {
            EventWho oEwho = new EventWho();
View Full Code Here

Examples of com.google.gdata.data.DateTime

      CalendarQuery myQuery = new CalendarQuery(feedUrl);

    String sTimeZone = DBCommand.queryStr(oConn, "SELECT "+DB.tx_timezone+" FROM "+DB.k_fellows+" WHERE "+DB.gu_fellow+"='"+oMeet.getString(DB.gu_fellow)+"'");
      if (null==sTimeZone) {
        myQuery.setMinimumStartTime(new DateTime(oMeet.getDate(DB.dt_start)));
        myQuery.setMaximumStartTime(new DateTime(oMeet.getDate(DB.dt_end)));
      if (DebugFile.trace) DebugFile.writeln("CalendarQuery.query("+feedUrl.toString()+","+oMeet.getDateTime24(DB.dt_start)+","+oMeet.getDateTime24(DB.dt_end)+", without time zone)");
      } else {
        int lSign = sTimeZone.charAt(0)=='+' ? 1 : -1;
        String[] aTimeZone = Gadgets.split2(sTimeZone.substring(1),':');
        SimpleTimeZone oTmz = new SimpleTimeZone(lSign*(Integer.parseInt(aTimeZone[0])*3600000+Integer.parseInt(aTimeZone[1])*60000), sTimeZone);
        myQuery.setMinimumStartTime(new DateTime(oMeet.getDate(DB.dt_start),oTmz));
        myQuery.setMaximumStartTime(new DateTime(oMeet.getDate(DB.dt_end),oTmz));
      if (DebugFile.trace) DebugFile.writeln("CalendarQuery.query("+feedUrl.toString()+","+oMeet.getDateTime24(DB.dt_start)+","+oMeet.getDateTime24(DB.dt_end)+", GMT "+oTmz.getID()+")");
      }

    CalendarEventFeed oFeed = oCalSrv.query(myQuery, CalendarEventFeed.class);   
    for (int i = 0; i < oFeed.getEntries().size(); i++) {
View Full Code Here

Examples of com.sun.star.util.DateTime

    static private Timestamp getTimestamp(final Object obj)
    {
        final Timestamp ts;
        if (obj instanceof DateTime)
        {
            final DateTime unoTs = (DateTime) obj;
            final StringBuffer str = getDateString(unoTs.Year, unoTs.Month, unoTs.Day);
            str.append(' ');
            str.append(getTimeString(unoTs.Hours, unoTs.Minutes, unoTs.Seconds));
            str.append('.');
            str.append(unoTs.HundredthSeconds);
View Full Code Here

Examples of hirondelle.date4j.DateTime

        Boolean fechaValida = Vistas.getInstance().alquiler.validarFecha(new JTextField(fecha.toString()));
        if (fechaValida) {
            a.setIdArticulo(Integer.parseInt(id.getText()));
            a.setTitulo(titulo.getText());
            a.setTema(tema.getText());
            a.setFechaPublicacion(new DateTime(fecha.toString()));
        } else {
            JOptionPane.showMessageDialog(null, "Fecha invalida, formato: DD/MM/AAAA");
        }

    }
View Full Code Here

Examples of hirondelle.web4j.model.DateTime

    }
  }
 
  private Float getUptime(HttpServletRequest aRequest){
    TimeZone tz = (TimeZone)getExistingSession().getServletContext().getAttribute(Controller.TIME_ZONE);
    DateTime now = DateTime.now(tz);
    DateTime startup = getStartTime();
    int SECONDS_PER_DAY = 86400;
    return new Float(startup.numSecondsFrom(now)/SECONDS_PER_DAY);
  }
View Full Code Here

Examples of hirondelle.web4j.model.DateTime

    }
    return result;
  }
 
  private DateTime parseDateTime(String aInputValue, Pattern aRegex){
    DateTime result = null;
    Matcher matcher = aRegex.matcher(aInputValue);
    if( matcher.matches() ) {
      DateTimeParts parts = getParts(matcher);
      Integer year = new Integer(parts.year);
      Integer month = new Integer(parts.month);
      Integer day = new Integer(parts.day);
      String hour = parts.hour;
      String minute = parts.minute;
      if( hour == null ){
        result = DateTime.forDateOnly(year, month, day);
      }
      else {
        Integer hourVal = new Integer(hour);
        Integer minuteVal = new Integer(minute);
        result = new DateTime(year, month, day, hourVal, minuteVal, null, null);
      }
    }
    return result;
  }
View Full Code Here

Examples of hirondelle.web4j.model.DateTime

      Calendar calendar = new GregorianCalendar(aYear, aMonth - 1, aDay, aHour, aMinute);
      return calendar.getTime();
    }

    private void testFormatDateTime(String aDateTime, String aExpected){
      DateTime dt = new DateTime(aDateTime);
      DateConverter converter = new DateConverterImpl();
      String actual = converter.formatEyeFriendlyDateTime(dt, null);
      if(!actual.equals(aExpected)){
        fail("Actual:'"+ actual + "' Expected:'" + aExpected + "'");
      }
View Full Code Here

Examples of hirondelle.web4j.model.DateTime

        fail("Actual:'"+ actual + "' Expected:'" + aExpected + "'");
      }
    }
   
    private void testParseEyeDateTime(String aInput, String aExpected){
      DateTime expected = new DateTime(aExpected);
      DateConverter converter = new DateConverterImpl();
      DateTime actual = converter.parseEyeFriendlyDateTime(aInput, null);
      if(!actual.equals(expected)){
        fail("Actual:" + actual + " Expected:" + aExpected);
      }
    }
View Full Code Here

Examples of hirondelle.web4j.model.DateTime

        fail("Actual:" + actual + " Expected:" + aExpected);
      }
    }
   
    private void testParseHandDateTime(String aInput, String aExpected){
      DateTime expected = new DateTime(aExpected);
      DateConverter converter = new DateConverterImpl();
      DateTime actual = converter.parseHandFriendlyDateTime(aInput, null);
      if(actual == null){
        fail("Failed to parse the input '" + aInput + "'");
      }
      else if(!actual.equals(expected)){
        fail("Actual:" + actual + " Expected:" + aExpected);
      }
    }
View Full Code Here

Examples of hirondelle.web4j.model.DateTime

    String month;
    String day;
  }
 
  private DateTime parseDateTime(String aInputValue, Pattern aRegex){
    DateTime result = null;
    Matcher matcher = aRegex.matcher(aInputValue);
    if( matcher.matches() ) {
      DateTimeParts parts = getParts(matcher);
      Integer year = new Integer(parts.year);
      Integer month = new Integer(parts.month);
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.