I am currently using an angular-calendar package for the Date view in the UI. I am having trouble getting the date range(start date & end date) of the view, i.e if I am currently in Monthly view, then I want the start date & end date of the monthly view & likewise for the Weekly view(start date of the week & end date of the week). How can I achieve it? I have to make the API calls according to the start date & end date of the calendar view.
You can use the moment library like
This Month': [moment().startOf('month'), moment().endOf('month')]
Last Year': [moment().subtract(1, 'years').startOf('years'),
moment().subtract(1, 'years').endOf('years'),]
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