How to type check a Date object in flow?

Aakash Sigdel picture Aakash Sigdel · Oct 20, 2016 · Viewed 10.7k times · Source

I have a function that takes a Date object as its paramater. I am not able to figure out how to annotate this.

How do I type annotate start and end as Date objects?

Answer

Aakash Sigdel picture Aakash Sigdel · Oct 20, 2016

Thanks loganfsmyth and Nikita for the comments. It works as expected.

function diffDate (start: Date, end: Date) {
   // ...
}