Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DateTime Picker: In Relative option when 'Yesterday' is selected it takes current date instead of yesterday date.. #1183

Closed
kalyanixraut opened this issue May 14, 2020 · 1 comment · Fixed by #1201

Comments

@kalyanixraut
Copy link
Collaborator

kalyanixraut commented May 14, 2020

Describe the bug

In Relative option of DateTime Picker, if we set 'Yesterday' as Relative to option, it’s not taking the yesterday date instead it’s showing today’s date.

relative_datepicker

<DateTimePicker
        dateTimeMask="YYYY-MM-DD"
        defaultValue={{
          label: 'Last 30 days',
          offset: 44640
        }}
        disabled={false}
        expanded={false}
        i18n={{
          absoluteLabel: 'Absolute',
          applyBtnLabel: 'Apply',
          backBtnLabel: 'Back',
          calendarLabel: 'Calendar',
          cancelBtnLabel: 'Cancel',
          customRangeLabel: 'Custom range',
          customRangeLinkLabel: 'Custom Range',
          endTimeLabel: 'End time',
          intervalLabels: [
            'days',
            'weeks',
            'months',
            'years'
          ],
          invalidNumberLabel: 'Number is not valid',
          lastLabel: 'Last',
          presetLabels: [
            'Last 7 days',
            'Last 30 days',
            'Last 90 days'
          ],
          relativeLabel: 'Relative',
          relativeLabels: [
            'Yesterday'
            // 'Today'
          ],
          relativeToLabel: 'Relative to',
          startTimeLabel: 'Start time',
          toLabel: 'to',
          toNowLabel: 'to yesterday'
        }}
        intervals={[
          {
            label: 'days',
            value: 'DAYS'
          },
          {
            label: 'weeks',
            value: 'WEEKS'
          },
          {
            label: 'months',
            value: 'MONTHS'
          },
          {
            label: 'years',
            value: 'YEARS'
          }
        ]}
        onCancel={null}
        presets={[
          {
            label: 'Last 7 days',
            offset: 11520,
            id: "7d"
          },
          {
            label: 'Last 30 days',
            offset: 44640,
            id: "30d"
          },
          {
            label: 'Last 90 days',
            offset: 131040,
            id: "90d"
          }
        ]}
        relatives={[
          {
            label: 'Yesterday',
            value: 'YESTERDAY'
          },
        ]}
        showRelativeOption
      />

Specific timeline issues / requests

Need this for June 2020 release.

@tay1orjones
Copy link
Member

🎉 This issue has been resolved in version 2.78.5 🎉

The release is available on:

Your semantic-release bot 📦🚀

@davidicus davidicus added this to the Sprint 49 milestone Jun 3, 2020
@davidicus davidicus self-assigned this Jun 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants