ngx-daterangepicker-material icon indicating copy to clipboard operation
ngx-daterangepicker-material copied to clipboard

UTC is changed to locale once the day is changed

Open JNicolasW opened this issue 5 years ago • 1 comments

Versions

  • Angular version: 9.1
  • component version: 2.4.1

Describe the bug A clear and concise description of what the bug is. I start the component as follow. to = {start: moment.utc(), end:moment.utc()} Which sets the picker information to be a UTC Moment object, but when i pick a different day (day only, not minutes or hours), it changes the UTC Moment object into a Moment object, which is not what I require.

To Reproduce Steps to reproduce the behavior:

  1. Create a simple picker, initialize it with two moment.utc() values
  2. Change the day selected to a different one, and it will change from moment.UTC into moment

Expected behavior If the input is an UTC object, it should keep it that way.

Value: Moment {_isAMomentObject: true, _isUTC: true, _pf: {…}, _locale: Locale, _d: Mon Sep 07 2020 12:57:29 GMT-0300 (Argentina Standard Time), …} Is UTC? true does it has an offset? 0

NEW VALUE Moment {_isAMomentObject: true, _i: Array(6), _isUTC: false, _pf: {…}, _locale: Locale, …}
is UTC? false
does it has an offset? -180

JNicolasW avatar Sep 07 '20 16:09 JNicolasW

@fetrarij - we face a similar issue in our app as well. Is there a workaround for this?

chetanshetty-gep avatar Mar 01 '22 14:03 chetanshetty-gep