Sha256: 05adf39576c6317e067e4b688b0aba45a560d9bc8f94bba09054449f2c66e092
Contents?: true
Size: 1.05 KB
Versions: 39
Compression:
Stored size: 1.05 KB
Contents
// ========================================================================== // Project: SproutCore - JavaScript Application Framework // Copyright: ©2006-2011 Apple Inc. and contributors. // License: Licensed under MIT license (see license.js) // ========================================================================== /*global module test equals context ok same */ module("SC.Validator.Date"); test("Converts into String if a number is given",function() { var date = SC.DateTime.create({milliseconds: 1234947136000 + (new Date().getTimezoneOffset() * 60000)}); var c = SC.Validator.Date.fieldValueForObject(date._ms, '', ''); var expected = "Feb 18, 2009 8:52:16 AM"; equals(c, expected, "Number converted to date format"); }); test("Converts into number when date string is given", function() { var expected = 1234918336000; var date = SC.DateTime.create(expected); var d = SC.Validator.Date.objectForFieldValue(date.toFormattedString('%b %d, %Y %i:%M:%S %p'),'',''); equals(d, expected, "Number of milliseconds returned is correct"); });
Version data entries
39 entries across 39 versions & 1 rubygems