Example #1
0
  locale: 2,
});
// $ExpectError
DateTime.fromFormat('12/15/2017, 12:47:25 PM', 'dd/MM/yyyy h:mm:ss a', {
  setZone: 'yes',
});
// $ExpectError
DateTime.fromFormat('12/15/2017, 12:47:25 PM', 'dd/MM/yyyy h:mm:ss a', {
  outputCalendar: 2,
});
// $ExpectError
DateTime.fromFormat('12/15/2017, 12:47:25 PM', 'dd/MM/yyyy h:mm:ss a', {
  numberingSystem: 2,
});

var date: DateTime = DateTime.invalid("test");
// $ExpectError
DateTime.invalid();

// Flow 0.40 - 0.45 allows these but they're incorrect...bug!
// DateTime.max();
// DateTime.min();

var date = DateTime.max(DateTime.local(), DateTime.utc(), DateTime.utc());
var date = DateTime.min(DateTime.local(), DateTime.utc(), DateTime.utc());
// $ExpectError
var date = DateTime.max(DateTime.local(), null, DateTime.utc());
// $ExpectError
var date = DateTime.min(DateTime.local(), null, DateTime.utc());

(date.day: number);