Package com.mdimension.jchronic.utils

Examples of com.mdimension.jchronic.utils.Span


  public void test_foo() {
    Chronic.parse("two months ago this friday");
  }

  public void test_parse_guess_r() {
    Span time;
    time = parse_now("friday");
    assertEquals(Time.construct(2006, 8, 18, 12), time);

    time = parse_now("tue");
    assertEquals(Time.construct(2006, 8, 22, 12), time);
View Full Code Here


    time = parse_now("november");
    assertEquals(Time.construct(2006, 11, 16), time);
  }

  public void test_parse_guess_rr() {
    Span time;
    time = parse_now("friday 13:00");
    assertEquals(Time.construct(2006, 8, 18, 13), time);

    time = parse_now("monday 4:00");
    assertEquals(Time.construct(2006, 8, 21, 16), time);
View Full Code Here

    time = parse_now("aug 24");
    assertEquals(Time.construct(2006, 8, 24, 12), time);
  }

  public void test_parse_guess_rrr() {
    Span time;
    time = parse_now("friday 1 pm");
    assertEquals(Time.construct(2006, 8, 18, 13), time);

    time = parse_now("friday 11 at night");
    assertEquals(Time.construct(2006, 8, 18, 23), time);
View Full Code Here

    time = parse_now("friday evening at 7");
    assertEquals(Time.construct(2006, 8, 18, 19), time);
  }

  public void test_parse_guess_gr() {
    Span time;
    // year

    time = parse_now("this year");
    assertEquals(Time.construct(2006, 10, 24, 12, 30), time);
View Full Code Here

    time = parse_now("last second");
    assertEquals(Time.construct(2006, 8, 16, 13, 59, 59), time);
  }

  public void test_parse_guess_grr() {
    Span time;
    time = parse_now("yesterday at 4:00");
    assertEquals(Time.construct(2006, 8, 15, 16), time);

    time = parse_now("today at 9:00");
    assertEquals(Time.construct(2006, 8, 16, 9), time);
View Full Code Here

    time = parse_now("7 tonight");
    assertEquals(Time.construct(2006, 8, 16, 19), time);
  }

  public void test_parse_guess_grrr() {
    Span time;
    time = parse_now("today at 6:00pm");
    assertEquals(Time.construct(2006, 8, 16, 18), time);

    time = parse_now("today at 6:00am");
    assertEquals(Time.construct(2006, 8, 16, 6), time);
View Full Code Here

    time = parse_now("next monday at 12:01 pm");
    assertEquals(Time.construct(2006, 8, 21, 12, 1), time);
  }

  public void test_parse_guess_rgr() {
    Span time;
    time = parse_now("afternoon yesterday");
    assertEquals(Time.construct(2006, 8, 15, 15), time);

    time = parse_now("tuesday last week");
    assertEquals(Time.construct(2006, 8, 8, 12), time);
View Full Code Here

    time = parse_now("tuesday last week");
    assertEquals(Time.construct(2006, 8, 8, 12), time);
  }

  public void test_parse_guess_s_r_p() {
    Span time;
    // past

    time = parse_now("3 years ago");
    assertEquals(Time.construct(2003, 8, 16, 14), time);
View Full Code Here

    time = Chronic.parse("2 months ago", options);
    assertEquals(Time.construct(2007, 1, 7, 23, 30), time);
  }

  public void test_parse_guess_p_s_r() {
    Span time;
    time = parse_now("in 3 hours");
    assertEquals(Time.construct(2006, 8, 16, 17), time);
  }
View Full Code Here

    time = parse_now("in 3 hours");
    assertEquals(Time.construct(2006, 8, 16, 17), time);
  }

  public void test_parse_guess_s_r_p_a() {
    Span time;
    // past

    time = parse_now("3 years ago tomorrow");
    assertEquals(Time.construct(2003, 8, 17, 12), time);
View Full Code Here

TOP

Related Classes of com.mdimension.jchronic.utils.Span

Copyright © 2018 www.massapicom. 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.