I have a settlement, I want to judge if the return_service_date is today, how to do this?
This is my code (rails):
if settlement.return_service_date &&
settlement.return_service_date.to_s(:date) == Time.now.to_s(:date)
Is there a better way to do this?
In Rails, you can do:
settlement.return_service_date.today?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With