List of usage examples for java.util Calendar SEPTEMBER
int SEPTEMBER
To view the source code for java.util Calendar SEPTEMBER.
Click Source Link
From source file:ch.cyberduck.core.ftp.parser.FreeboxFTPEntryParserTest.java
@Test public void testParse() { FTPFile parsed;/*w ww .j ava 2s . co m*/ parsed = parser.parseFTPEntry( "-rw-r--r-- 1 freebox freebox 2064965868 Apr 15 21:17 M6 - Capital 15-04-2007 21h37 1h40m.ts"); assertNotNull(parsed); assertEquals(parsed.getName(), "M6 - Capital 15-04-2007 21h37 1h40m.ts"); assertEquals(FTPFile.FILE_TYPE, parsed.getType()); assertEquals("freebox", parsed.getUser()); assertEquals("freebox", parsed.getGroup()); assertEquals(2064965868, parsed.getSize()); assertEquals(Calendar.APRIL, parsed.getTimestamp().get(Calendar.MONTH)); assertEquals(15, parsed.getTimestamp().get(Calendar.DAY_OF_MONTH)); parsed = parser.parseFTPEntry( "-rw-r--r-- 1 freebox freebox 75906880 Sep 08 06:33 Direct 8 - Gym direct - 08-09-2007 08h30 1h08m.ts"); assertNotNull(parsed); assertEquals("Direct 8 - Gym direct - 08-09-2007 08h30 1h08m.ts", parsed.getName()); assertEquals(FTPFile.FILE_TYPE, parsed.getType()); assertEquals("freebox", parsed.getUser()); assertEquals("freebox", parsed.getGroup()); assertEquals(75906880, parsed.getSize()); assertEquals(Calendar.SEPTEMBER, parsed.getTimestamp().get(Calendar.MONTH)); assertEquals(8, parsed.getTimestamp().get(Calendar.DAY_OF_MONTH)); assertTrue(parsed.hasPermission(FTPFile.USER_ACCESS, FTPFile.READ_PERMISSION)); assertTrue(parsed.hasPermission(FTPFile.GROUP_ACCESS, FTPFile.READ_PERMISSION)); assertTrue(parsed.hasPermission(FTPFile.WORLD_ACCESS, FTPFile.READ_PERMISSION)); assertTrue(parsed.hasPermission(FTPFile.USER_ACCESS, FTPFile.WRITE_PERMISSION)); assertFalse(parsed.hasPermission(FTPFile.GROUP_ACCESS, FTPFile.WRITE_PERMISSION)); assertFalse(parsed.hasPermission(FTPFile.WORLD_ACCESS, FTPFile.WRITE_PERMISSION)); assertFalse(parsed.hasPermission(FTPFile.USER_ACCESS, FTPFile.EXECUTE_PERMISSION)); assertFalse(parsed.hasPermission(FTPFile.GROUP_ACCESS, FTPFile.EXECUTE_PERMISSION)); assertFalse(parsed.hasPermission(FTPFile.WORLD_ACCESS, FTPFile.EXECUTE_PERMISSION)); parsed = parser.parseFTPEntry( "-rw-r--r-- 1 freebox freebox 1171138668 May 19 17:20 France 3 national - 19-05-2007 18h15 1h05m.ts"); assertNotNull(parsed); assertEquals("France 3 national - 19-05-2007 18h15 1h05m.ts", parsed.getName()); }
From source file:net.audumla.astronomy.SeasonTest.java
@Test public void testAutumnStart() throws Exception { SeasonalEvent event = new SeasonalEvent(SeasonalEvent.AUTUMNSTART, Geolocation.newGeoLocation(30, 0, 0)); Date et = event.calculateEventFrom(new Date()); assert DateUtils.toCalendar(et).get(Calendar.MONTH) == Calendar.SEPTEMBER; event = new SeasonalEvent(SeasonalEvent.AUTUMNSTART, Geolocation.newGeoLocation(-30, 0, 0)); et = event.calculateEventFrom(new Date()); assert DateUtils.toCalendar(et).get(Calendar.MONTH) == Calendar.MARCH; }
From source file:de.forsthaus.backend.dao.impl.ChartDataDAOImpl.java
@Override public List<ChartData> getChartDataForCustomer(long kunId) { List<ChartData> result = new ArrayList<ChartData>(); if (kunId == 20) { Calendar calendar = new GregorianCalendar(); calendar.set(2009, Calendar.JANUARY, 2, 0, 0, 0); result.add(new ChartData(kunId, calendar.getTime(), new BigDecimal(120.30))); calendar.set(2009, Calendar.FEBRUARY, 2, 0, 0, 0); result.add(new ChartData(kunId, calendar.getTime(), new BigDecimal(450.30))); calendar.set(2009, Calendar.MARCH, 15, 0, 0, 0); result.add(new ChartData(kunId, calendar.getTime(), new BigDecimal(820.10))); calendar.set(2009, Calendar.APRIL, 20, 0, 0, 0); result.add(new ChartData(kunId, calendar.getTime(), new BigDecimal(654.00))); calendar.set(2009, Calendar.MAY, 2, 0, 0, 0); result.add(new ChartData(kunId, calendar.getTime(), new BigDecimal(120.30))); calendar.set(2009, Calendar.JUNE, 2, 0, 0, 0); result.add(new ChartData(kunId, calendar.getTime(), new BigDecimal(520.30))); calendar.set(2009, Calendar.JULY, 22, 0, 0, 0); result.add(new ChartData(kunId, calendar.getTime(), new BigDecimal(320.30))); calendar.set(2009, Calendar.AUGUST, 13, 0, 0, 0); result.add(new ChartData(kunId, calendar.getTime(), new BigDecimal(20.30))); calendar.set(2009, Calendar.SEPTEMBER, 6, 0, 0, 0); result.add(new ChartData(kunId, calendar.getTime(), new BigDecimal(480.30))); calendar.set(2009, Calendar.OCTOBER, 26, 0, 0, 0); result.add(new ChartData(kunId, calendar.getTime(), new BigDecimal(520.30))); calendar.set(2009, Calendar.NOVEMBER, 26, 0, 0, 0); result.add(new ChartData(kunId, calendar.getTime(), new BigDecimal(620.70))); calendar.set(2009, Calendar.DECEMBER, 26, 0, 0, 0); result.add(new ChartData(kunId, calendar.getTime(), new BigDecimal(1220.90))); } else if (kunId == 21) { Calendar calendar = new GregorianCalendar(); calendar.set(2009, Calendar.JANUARY, 2, 0, 0, 0); result.add(new ChartData(kunId, calendar.getTime(), new BigDecimal(320.30))); calendar.set(2009, Calendar.FEBRUARY, 2, 0, 0, 0); result.add(new ChartData(kunId, calendar.getTime(), new BigDecimal(450.30))); calendar.set(2009, Calendar.MARCH, 15, 0, 0, 0); result.add(new ChartData(kunId, calendar.getTime(), new BigDecimal(620.10))); calendar.set(2009, Calendar.APRIL, 20, 0, 0, 0); result.add(new ChartData(kunId, calendar.getTime(), new BigDecimal(154.00))); calendar.set(2009, Calendar.MAY, 2, 0, 0, 0); result.add(new ChartData(kunId, calendar.getTime(), new BigDecimal(320.30))); calendar.set(2009, Calendar.JUNE, 2, 0, 0, 0); result.add(new ChartData(kunId, calendar.getTime(), new BigDecimal(620.30))); calendar.set(2009, Calendar.JULY, 22, 0, 0, 0); result.add(new ChartData(kunId, calendar.getTime(), new BigDecimal(920.30))); calendar.set(2009, Calendar.AUGUST, 13, 0, 0, 0); result.add(new ChartData(kunId, calendar.getTime(), new BigDecimal(120.30))); calendar.set(2009, Calendar.SEPTEMBER, 6, 0, 0, 0); result.add(new ChartData(kunId, calendar.getTime(), new BigDecimal(680.30))); calendar.set(2009, Calendar.OCTOBER, 26, 0, 0, 0); result.add(new ChartData(kunId, calendar.getTime(), new BigDecimal(580.30))); calendar.set(2009, Calendar.NOVEMBER, 26, 0, 0, 0); result.add(new ChartData(kunId, calendar.getTime(), new BigDecimal(820.70))); calendar.set(2009, Calendar.DECEMBER, 26, 0, 0, 0); result.add(new ChartData(kunId, calendar.getTime(), new BigDecimal(220.90))); }/*from w ww . j a v a 2s . c om*/ return result; }
From source file:util.MyUtils.java
public static String getMonthString(int month) { switch (month - 1) { case Calendar.JANUARY: return "Jan"; case Calendar.FEBRUARY: return "Feb"; case Calendar.MARCH: return "Mar"; case Calendar.APRIL: return "Apr"; case Calendar.MAY: return "May"; case Calendar.JUNE: return "Jun"; case Calendar.JULY: return "Jul"; case Calendar.AUGUST: return "Aug"; case Calendar.SEPTEMBER: return "Sep"; case Calendar.OCTOBER: return "Oct"; case Calendar.NOVEMBER: return "Nov"; case Calendar.DECEMBER: return "Dec"; }//from ww w . j a va2 s .c o m return ""; }
From source file:one.GanttDemo1.java
/** * Creates a sample dataset for a Gantt chart. * * @return The dataset.//from w ww.ja va2s . c om */ public static IntervalCategoryDataset createDataset() { final TaskSeries s1 = new TaskSeries("Scheduled"); s1.add(new Task("Write Proposal", new SimpleTimePeriod(date(1, Calendar.APRIL, 2001), date(5, Calendar.APRIL, 2001)))); s1.add(new Task("Obtain Approval", new SimpleTimePeriod(date(9, Calendar.APRIL, 2001), date(9, Calendar.APRIL, 2001)))); s1.add(new Task("Requirements Analysis", new SimpleTimePeriod(date(10, Calendar.APRIL, 2001), date(5, Calendar.MAY, 2001)))); s1.add(new Task("Design Phase", new SimpleTimePeriod(date(6, Calendar.MAY, 2001), date(30, Calendar.MAY, 2001)))); s1.add(new Task("Design Signoff", new SimpleTimePeriod(date(2, Calendar.JUNE, 2001), date(2, Calendar.JUNE, 2001)))); s1.add(new Task("Alpha Implementation", new SimpleTimePeriod(date(3, Calendar.JUNE, 2001), date(31, Calendar.JULY, 2001)))); s1.add(new Task("Design Review", new SimpleTimePeriod(date(1, Calendar.AUGUST, 2001), date(8, Calendar.AUGUST, 2001)))); s1.add(new Task("Revised Design Signoff", new SimpleTimePeriod(date(10, Calendar.AUGUST, 2001), date(10, Calendar.AUGUST, 2001)))); s1.add(new Task("Beta Implementation", new SimpleTimePeriod(date(12, Calendar.AUGUST, 2001), date(12, Calendar.SEPTEMBER, 2001)))); s1.add(new Task("Testing", new SimpleTimePeriod(date(13, Calendar.SEPTEMBER, 2001), date(31, Calendar.OCTOBER, 2001)))); s1.add(new Task("Final Implementation", new SimpleTimePeriod(date(1, Calendar.NOVEMBER, 2001), date(15, Calendar.NOVEMBER, 2001)))); s1.add(new Task("Signoff", new SimpleTimePeriod(date(28, Calendar.NOVEMBER, 2001), date(30, Calendar.NOVEMBER, 2001)))); s1.add(new Task("Database set up", new SimpleTimePeriod(date(15, Calendar.OCTOBER, 2001), date(30, Calendar.OCTOBER, 2001)))); final TaskSeries s2 = new TaskSeries("Actual"); s2.add(new Task("Write Proposal", new SimpleTimePeriod(date(1, Calendar.APRIL, 2001), date(5, Calendar.APRIL, 2001)))); s2.add(new Task("Obtain Approval", new SimpleTimePeriod(date(9, Calendar.APRIL, 2001), date(9, Calendar.APRIL, 2001)))); s2.add(new Task("Requirements Analysis", new SimpleTimePeriod(date(10, Calendar.APRIL, 2001), date(15, Calendar.MAY, 2001)))); s2.add(new Task("Design Phase", new SimpleTimePeriod(date(15, Calendar.MAY, 2001), date(17, Calendar.JUNE, 2001)))); s2.add(new Task("Design Signoff", new SimpleTimePeriod(date(30, Calendar.JUNE, 2001), date(30, Calendar.JUNE, 2001)))); s2.add(new Task("Alpha Implementation", new SimpleTimePeriod(date(1, Calendar.JULY, 2001), date(12, Calendar.SEPTEMBER, 2001)))); s2.add(new Task("Design Review", new SimpleTimePeriod(date(12, Calendar.SEPTEMBER, 2001), date(22, Calendar.SEPTEMBER, 2001)))); s2.add(new Task("Revised Design Signoff", new SimpleTimePeriod(date(25, Calendar.SEPTEMBER, 2001), date(27, Calendar.SEPTEMBER, 2001)))); s2.add(new Task("Beta Implementation", new SimpleTimePeriod(date(27, Calendar.SEPTEMBER, 2001), date(30, Calendar.OCTOBER, 2001)))); s2.add(new Task("Testing", new SimpleTimePeriod(date(31, Calendar.OCTOBER, 2001), date(17, Calendar.NOVEMBER, 2001)))); s2.add(new Task("Final Implementation", new SimpleTimePeriod(date(18, Calendar.NOVEMBER, 2001), date(5, Calendar.DECEMBER, 2001)))); s2.add(new Task("Signoff", new SimpleTimePeriod(date(10, Calendar.DECEMBER, 2001), date(11, Calendar.DECEMBER, 2001)))); final TaskSeriesCollection collection = new TaskSeriesCollection(); collection.add(s1); collection.add(s2); return collection; }
From source file:org.lieuofs.geo.territoire.biz.dao.EtatTerritoireFichierXmlDaoTest.java
@Test public void lireSuisse() { EtatTerritoirePersistant suisse = dao.lire(8100); assertEquals("N OFS Suisse", 8100, suisse.getNumeroOFS()); InfosONUetISO3166 infos = suisse.getInfosISO(); assertNotNull("Infos Onu Iso non nulles", infos); assertEquals("Info Onu numrique", 756, infos.getCodeNumeriqueONU()); assertEquals("Info ISO alpha 2", "CH", infos.getCodeIsoAlpha2()); assertEquals("Info ISO alpha 3", "CHE", infos.getCodeIsoAlpha3()); assertEquals("Forme courte allemande", "Schweiz", suisse.getFormeCourte("de")); assertEquals("Forme courte franaise", "Suisse", suisse.getFormeCourte("fr")); assertEquals("Forme courte italienne", "Svizzera", suisse.getFormeCourte("it")); assertEquals("Forme courte anglaise", "Switzerland", suisse.getFormeCourte("en")); assertEquals("Dsignation allemande", "Schweizerische Eidgenossenschaft", suisse.getDesignationOfficielle("de")); assertEquals("Dsignation franaise", "Confdration suisse", suisse.getDesignationOfficielle("fr")); assertEquals("Dsignation italienne", "Confederazione svizzera", suisse.getDesignationOfficielle("it")); assertEquals("Continent", 1, suisse.getNumContinent()); assertEquals("Rgion", 3, suisse.getNumRegion()); assertTrue("Est un tat", suisse.isEtat()); assertEquals("La Suisse est un tat : pas de rattachement", 0, suisse.getNumEtatRattachement()); assertTrue("Est membre de l'ONU", suisse.isMembreONU()); Calendar cal = Calendar.getInstance(); cal.setTime(suisse.getDateEntreeONU()); assertEquals("Jour entre ONU", 10, cal.get(Calendar.DATE)); assertEquals("mois entre ONU", Calendar.SEPTEMBER, cal.get(Calendar.MONTH)); assertEquals("anne entre ONU", 2002, cal.get(Calendar.YEAR)); assertFalse("Non reconnu par la Suisse", suisse.isReconnuSuisse()); assertNull("Date reconnaissance Suisse", suisse.getDateReconnaissance()); assertNull("Remarque en allemand", suisse.getRemarque("de")); assertNull("Remarque en franais", suisse.getRemarque("fr")); assertNull("Remarque en italien", suisse.getRemarque("it")); assertTrue("valide", suisse.isValide()); cal.setTime(suisse.getDateDernierChangement()); assertEquals("Jour dernier changement", 1, cal.get(Calendar.DATE)); assertEquals("mois dernier changement", Calendar.JANUARY, cal.get(Calendar.MONTH)); assertEquals("anne dernier changement", 2008, cal.get(Calendar.YEAR)); }
From source file:net.audumla.astronomy.SeasonTest.java
@Test public void testSpringStart() throws Exception { SeasonalEvent event = new SeasonalEvent(SeasonalEvent.SPRINGSTART, Geolocation.newGeoLocation(30, 0, 0)); Date et = event.calculateEventFrom(new Date()); assert DateUtils.toCalendar(et).get(Calendar.MONTH) == Calendar.MARCH; event = new SeasonalEvent(SeasonalEvent.SPRINGSTART, Geolocation.newGeoLocation(-30, 0, 0)); et = event.calculateEventFrom(new Date()); assert DateUtils.toCalendar(et).get(Calendar.MONTH) == Calendar.SEPTEMBER; }
From source file:net.audumla.astronomy.SeasonalEvent.java
protected static double autumnStart(int year, double latitude) { Date t = Time.getZeroDate(); t = DateUtils.setYears(t, year);//from ww w . j a va2 s .c o m if (latitude >= 0) { t = DateUtils.setMonths(t, Calendar.SEPTEMBER); } else { t = DateUtils.setMonths(t, Calendar.MARCH); } return new JulianDate(t).julian(); }
From source file:org.richfaces.component.CalendarComponentTest.java
public void setUp() throws Exception { super.setUp(); form = new HtmlForm(); form.setId("form"); facesContext.getViewRoot().getChildren().add(form); calendar = (UICalendar) application.createComponent(UICalendar.COMPONENT_TYPE); calendar1 = (UICalendar) application.createComponent(UICalendar.COMPONENT_TYPE); calendar.setLocale(Locale.UK); calendar.setDatePattern("d/MM/yyyy"); calendar.setTimeZone(TimeZone.getTimeZone("GMT-4:00")); calendar.setButtonLabel("PopUp"); // XXX test popup false // XXX test CurrentDate = null calendar.setPopup(true);/*from w ww . jav a 2 s . c o m*/ Calendar calendarObject = Calendar.getInstance(); calendarObject.clear(); calendarObject.set(2001, Calendar.SEPTEMBER, 11, 10, 0, 0); calendar.setId("calendar"); calendar.setValue(calendarObject.getTime()); form.getChildren().add(calendar); calendar1.setId("_calendar"); calendar1.setPopup(false); calendar1.setCurrentDate(null); form.getChildren().add(calendar1); calendar2 = (UICalendar) application.createComponent(UICalendar.COMPONENT_TYPE); calendar2.setDatePattern("dd/M/yy HH:mm"); calendarObject.set(2001, Calendar.SEPTEMBER, 11, 13, 36); calendar2.setValue(calendarObject.getTime()); calendar2.setId("timecalendar"); form.getChildren().add(calendar2); calendar3 = (UICalendar) application.createComponent(UICalendar.COMPONENT_TYPE); calendar3.setDatePattern("dd/M/yy HH:mm"); calendarObject.set(2001, Calendar.SEPTEMBER, 11, 13, 36); calendar3.setValue(calendarObject.getTime()); calendar3.setId("timecalendar"); calendar3.setMode(UICalendar.AJAX_MODE); calendar3.setLocale(new Locale("ru", "RU", "")); calendar3.setCellHeight("50"); calendar3.setCellWidth("50"); form.getChildren().add(calendar3); }
From source file:net.audumla.astronomy.SeasonalEvent.java
protected static double springStart(int year, double latitude) { Date t = Time.getZeroDate(); t = DateUtils.setYears(t, year);/*from www . j a v a 2s .c o m*/ if (latitude >= 0) { t = DateUtils.setMonths(t, Calendar.MARCH); } else { t = DateUtils.setMonths(t, Calendar.SEPTEMBER); } return new JulianDate(t).julian(); }