fragaria / angular-daterangepicker

Angular.js wrapper for dangrossman/bootstrap-daterangepicker
MIT License
519 stars 371 forks source link

end date and start is a day less than specified ia apply using angularjs #165

Closed Gurpindersingh closed 5 years ago

Gurpindersingh commented 8 years ago

Hi team, I am facing a serious issue when i specify date range using apply . Both the dates are a day less, but at starting i mean without applying a specified date in watcher function. It gives me both current accurate dates. Please help me. Thanks for your co-operation.

egesu commented 8 years ago

Hello,

Daterangepicker stores the selected date as timestamp with timezone. So if your locale is in the east of Greenwich, for example +02:00, then when you select 2015-01-19, the data stored is 2015-01-18T22:00:00.000Z.

If you need to send the date (but just date) to api for example, then you can use startDate = startDate.format('YYYY-MM-DD') to get real date.