Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get Date range in angular-calendar view

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.

like image 516
Saigal Amatya Avatar asked Nov 30 '25 00:11

Saigal Amatya


1 Answers

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'),]
like image 178
Ashish S Avatar answered Dec 01 '25 15:12

Ashish S



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!