Hızlı yanıt: kod örneği
stackoverflow.com check-if-a-moment-contains-a-time
Well technically, the constructor that passes only a date IS instantiating it with a time, 12:00:00, even though it is implicit. Even so, here are some possible solutions.From least safe and least work to most safe and most work:1) Check if it's exactly equal to 12:00:00 and assume it was not set. Bad approach if your use-case has things happening around midnight often.2) Don't ever instantiate a moment without explicitly specifying the time.3) Wrap moment in a custom object, or create an entirely new custom object, capable of representing the null time case (a flag, nullable variable, etc.)