Pastebin launched a little side project called HostCabi.net, check it out ;-)Don't like ads? PRO users don't see any ads ;-)
Guest

Stackoverflow 4597541

By: a guest on Jan 5th, 2011  |  syntax: JavaScript  |  size: 0.62 KB  |  hits: 31  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. goog.provide('moose.test');
  2.  
  3. goog.require('goog.array');
  4. goog.require('goog.date');
  5.  
  6.  
  7. moose.test = function() {
  8.     var d1 = new goog.date.Date(2010, 12, 24);
  9.     var d2 = new goog.date.Date(2011, 1, 6);
  10.     var d3 = new goog.date.Date(2010, 12, 30);
  11.     var singleDateObject = new goog.date.DateTime(2011, 1, 12, 13, 56, 57);
  12.     var dates = [d1, d2, d3];
  13.     var isIn = goog.array.find(dates, goog.partial(goog.date.isSameDay, singleDateObject));
  14.     var isIt = goog.array.findIndex(dates, function(range) { return goog.date.isSameDay(range, singleDateObject); });
  15.     console.log(isIn);
  16.     console.log(isIt);
  17. };