{"action":"created","issue":{"url":"https://api.github.com/repos/Hacker0x01/react-datepicker/issues/727","repository_url":"https://api.github.com/repos/Hacker0x01/react-datepicker","labels_url":"https://api.github.com/repos/Hacker0x01/react-datepicker/issues/727/labels{/name}","comments_url":"https://api.github.com/repos/Hacker0x01/react-datepicker/issues/727/comments","events_url":"https://api.github.com/repos/Hacker0x01/react-datepicker/issues/727/events","html_url":"https://github.com/Hacker0x01/react-datepicker/issues/727","id":204242369,"number":727,"title":"Today's date indicator does not work properly when utcOffset is used","user":{"login":"marekadamek","id":8816641,"avatar_url":"https://avatars2.githubusercontent.com/u/8816641?v=4","gravatar_id":"","url":"https://api.github.com/users/marekadamek","html_url":"https://github.com/marekadamek","followers_url":"https://api.github.com/users/marekadamek/followers","following_url":"https://api.github.com/users/marekadamek/following{/other_user}","gists_url":"https://api.github.com/users/marekadamek/gists{/gist_id}","starred_url":"https://api.github.com/users/marekadamek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marekadamek/subscriptions","organizations_url":"https://api.github.com/users/marekadamek/orgs","repos_url":"https://api.github.com/users/marekadamek/repos","events_url":"https://api.github.com/users/marekadamek/events{/privacy}","received_events_url":"https://api.github.com/users/marekadamek/received_events","type":"User","site_admin":false},"labels":[{"id":108712616,"url":"https://api.github.com/repos/Hacker0x01/react-datepicker/labels/bug","name":"bug","color":"fc2929","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2017-01-31T09:27:13Z","updated_at":"2017-11-15T09:55:14Z","closed_at":null,"author_association":"NONE","body":"Hi,\r\n\r\nI'm using the datepicker v0.37.0 with offset, like this:\r\n<DatePicker\r\n                    utcOffset={userUtcOffset()}\r\n...\r\n</DatePicker>\r\n\r\nLet's say it's 6pm browser time and offset is set to 600. It means that there's 1day difference between local today and today with offset.\r\n\r\nToday's button works correctly. It set's the right date (1 day after browser time). However today's indicator in the popup - red border and bold font - points to browser time. \r\n\r\nThanks,\r\nMarek Adamek\r\n"},"comment":{"url":"https://api.github.com/repos/Hacker0x01/react-datepicker/issues/comments/344542350","html_url":"https://github.com/Hacker0x01/react-datepicker/issues/727#issuecomment-344542350","issue_url":"https://api.github.com/repos/Hacker0x01/react-datepicker/issues/727","id":344542350,"user":{"login":"marekadamek","id":8816641,"avatar_url":"https://avatars2.githubusercontent.com/u/8816641?v=4","gravatar_id":"","url":"https://api.github.com/users/marekadamek","html_url":"https://github.com/marekadamek","followers_url":"https://api.github.com/users/marekadamek/followers","following_url":"https://api.github.com/users/marekadamek/following{/other_user}","gists_url":"https://api.github.com/users/marekadamek/gists{/gist_id}","starred_url":"https://api.github.com/users/marekadamek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marekadamek/subscriptions","organizations_url":"https://api.github.com/users/marekadamek/orgs","repos_url":"https://api.github.com/users/marekadamek/repos","events_url":"https://api.github.com/users/marekadamek/events{/privacy}","received_events_url":"https://api.github.com/users/marekadamek/received_events","type":"User","site_admin":false},"created_at":"2017-11-15T09:55:14Z","updated_at":"2017-11-15T09:55:14Z","author_association":"NONE","body":"Ok. I did some investigation and found solution working for me. The datepicker definition I have looks like this:\r\n\r\n<DatePicker\r\n                    utcOffset={userUtcOffset() / 60}\r\n                    name={name}\r\n                    placeholderText={placeholder}\r\n                    dateFormat={displayDateFormat}\r\n                    todayButton={msg('buttons.today.label')}\r\n                    selected={selectedDate}\r\n                    openToDate={openToDate}\r\n                    onBlur={this.handleBlur}\r\n                    onChange={this.handleChange}\r\n                    onFocus={onFocus}\r\n                    minDate={minDate}\r\n                    maxDate={maxDate}\r\n                    startDate={type && (type === 'start' ? selectedDate : minDate)}\r\n                    endDate={type && (type === 'end' ? selectedDate : maxDate)}\r\n                    selectsStart={type && type === 'start'}\r\n                    selectsEnd={type && type === 'end'}\r\n                    className={`form-control ${this.props.className}`}\r\n                    disabled={disabled}\r\n                    showMonthDropdown\r\n                    showYearDropdown\r\n                    dropdownMode=\"select\"\r\n                    isClearable={clearable}\r\n                />\r\n\r\nI noticed that I was passing dates with different utc offsets. and in case of openToDate, startDate and endDate the provided offset was overriding the value provided in utcOffset prop. \r\n\r\nI changed the code to always provide dates with the offset matching utcOffset and and problem disappeared. I'll leave it up to you to decide whether it is a bug or feature."}}
{"actor":{"display_login":"marekadamek"}}