RebbVal
EN
EN
  • Getting Started
  • Overview
  • Concepts
  • List of rules
    • Age
    • Array
    • Boolean
    • Comparions
    • Composite
    • Datetime
    • Identifications
    • Internet
    • Localization
    • String
Powered by GitBook
On this page
  • is leapyear
  • is leapday
  • Also see

Was this helpful?

  1. List of rules

Datetime

All rules in this page can be applies to date

is leapyear

Input a date, validtes the input is in a leap year

RebbVal v = new RebbVal();

SimpleDateFormat ft = new SimpleDateFormat ("yyyy-MM-dd");
Date date = ft.parse("2020-05-01");

v.val(date, "is leapyear"); // true
let v = new RebbVal();

v.val(new Date("2020-05-01"), "is leapyear"); //true

use functrion year() of RebbVal to convert string to date

v.val(v.year("2000"), "is leapyear"); // true
v.val(v.year("2000"), "is leapyear")); //true

In JavaScript, you can use a integer as year

// Java implementation does not support integer as year
// in JavaScript, you can use a interger as year
v.val(2020, "is leapyear"); // true

is leapday

Take a date as input, validates the input is a leap day

SimpleDateFormat ft = new SimpleDateFormat ("yyyy-MM-dd");
Date date = ft.parse("2000-02-29");
assertTrue(v.val(date, "is leapyear"));
v.val(new Date("2020-02-29"), "is leapday"); //true

Also see

PreviousCompositeNextIdentifications

Last updated 3 years ago

Was this helpful?

RebbValhas a functiondate()to parse string to Date, see for more detail

Age
Comparions
Concepts