APISonar


org.joda.time.format.ISODateTimeFormat.date

> org > joda > time > format > ISODateTimeFormat > date
org APIs joda APIs time APIs format APIs ISODateTimeFormat APIs date APIs

Example 1
public CalendarDates(List<String> datelist) {
		this.dates = new HashSet<LocalDate>();
		if (dates != null) {
			for (String date: datelist) {
				dates.add(LocalDate.parse(date,ISODateTimeFormat.date()));
			}
		} 
	}
Example 2
public static Slice toISO8601FromDate(ConnectorSession session, @SqlType(StandardTypes.DATE) long date)
    {
        DateTimeFormatter formatter = ISODateTimeFormat.date()
                .withChronology(UTC_CHRONOLOGY);
        return utf8Slice(formatter.print(DAYS.toMillis(date)));
    }
Example 3
@Override public LocalDate deserialize(JsonParser jsonParser,
            DeserializationContext deserializationContext)
            throws IOException, JsonProcessingException {
        return ISODateTimeFormat.date().parseLocalDate(jsonParser.getValueAsString());
    }
Example 4
public Literal visitDateEscapedLiteral(DateEscapedLiteralContext ctx) {
        String string = string(ctx.string());
        Location loc = source(ctx);
        // parse yyyy-MM-dd
        DateTime dt = null;
        try {
            dt = ISODateTimeFormat.date().parseDateTime(string);
        } catch(IllegalArgumentException ex) {
            throw new ParsingException(loc, "Invalid date received; {}", ex.getMessage());
        }
        return new Literal(loc, DateUtils.of(dt), DataType.DATE);
    }
Example 5
@Override public void serialize(LocalDate localDate, JsonGenerator jsonGenerator,
            SerializerProvider serializerProvider) throws IOException, JsonProcessingException {
        jsonGenerator.writeString(localDate.toString(ISODateTimeFormat.date()));
    }
Example 6
public ConvertDateToString(ScalarWriter baseWriter) {
    super(baseWriter);
    final String formatValue = baseWriter.schema().format();
    dateTimeFormatter = formatValue == null
      ? ISODateTimeFormat.date() : DateTimeFormat.forPattern(formatValue);
  }
Example 7
public void fromMethodNameTwoPathVariables() {
		DateTime now = DateTime.now();
		UriComponents uriComponents = fromMethodName(
				ControllerWithMethods.class, "methodWithTwoPathVariables", 1, now).build();

		assertThat(uriComponents.getPath(), is("/something/1/foo/" + ISODateTimeFormat.date().print(now)));
	}
Example 8
void usesDateTimeFormatForUriBinding() {

		DateTime now = DateTime.now();

		ControllerLinkBuilderFactory factory = new ControllerLinkBuilderFactory();
		Link link = factory.linkTo(methodOn(SampleController.class).sampleMethod(now)).withSelfRel();
		assertThat(link.getHref()).endsWith("/sample/" + ISODateTimeFormat.date().print(now));
	}