web/test/jstests/test_datetime.js
author Sylvain Thénault <sylvain.thenault@logilab.fr>
Thu, 10 Jun 2010 14:16:47 +0200
changeset 5712 e136d392bd71
parent 5658 7b9553a9db65
permissions -rw-r--r--
[form] refactor meta-attributes handling: hide them by default using uicfg.afs instead of returning None (or not, according to skip_meta_attr flag argument) in guess_field

$(document).ready(function() {

  module("datetime tests");

  test("test full datetime", function() {
      equals(cw.utils.toISOTimestamp(new Date(1986, 3, 18, 10, 30, 0, 0)),
	     '1986-04-18 10:30:00');
  });

  test("test only date", function() {
      equals(cw.utils.toISOTimestamp(new Date(1986, 3, 18)), '1986-04-18 00:00:00');
  });

  test("test null", function() {
      equals(cw.utils.toISOTimestamp(null), null);
  });


});