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

Added improvements to air-datepicker #599

Open
bgabor78 opened this issue Mar 19, 2024 · 0 comments
Open

Added improvements to air-datepicker #599

bgabor78 opened this issue Mar 19, 2024 · 0 comments

Comments

@bgabor78
Copy link

Dear Air-datepicker developers,

First of all, We would like to congratulate you on the development, because you have created a very useful tool.
In our projects, we plan to replace the current date picker with this component.
We had some further development needs that we prepared and would like to share them with you.
We hope that these changes can become part of the components further releases.

The improvements we carried out:

  • adding a "seconds" field to the time format
  • triggering the "onchange" event of the input field in the event of a date change
  • correction of decision to switch dates if enddatetime is before startdatetime
  • new isSameDateTime function to handle same date but different time situations
  • Quickselect "plugin", to add option to select frequently used datetimes
    Quickselect works only if range is true and quickselect array is not empty. To use it, you have to add options to quickselect array elemements as in the example below.
    Datetime definitions:
    - relative time: value (decimal) and unit string, where unit is one of these options:
    second: "s",
    minute: "m",
    hour: "h",
    day: "d",
    week: "w",
    month: "M",
    year: "Y"
    - constants:
    "now"
    "today" - current day 00:00:00
    "lastdaystart" - previous day 00:00:00
    "lastdayend" - previous day 23:59:59
    "weekstart" - current week first day 00:00:00
    "lastweekstart" - previous week first day 00:00:00
    "lastweekend" - previous week last day 23:59:59
    "monthstart" - current month first day 00:00:00
    "monthend" - current month last day 23:59:59
    "lastmonthstart" - previous month first day 00:00:00
    "lastmonthend" - previous month last day 23:59:59
    Example:
    quickselect: [
    {
    content: 'Today',
    startdate: 'today',
    enddate: 'now'
    },
    {
    content: 'Yesterday',
    startdate: 'lastdaystart',
    enddate: 'lastdayend'
    },
    {
    content: 'Current week',
    startdate: 'weekstart',
    enddate: 'now'
    },
    {
    content: 'Previous week',
    startdate: 'lastweekstart',
    enddate: 'lastweekend'
    },
    {
    content: 'Current month',
    startdate: 'monthstart',
    enddate: 'now'
    },
    {
    content: 'Previous month',
    startdate: 'lastmonthstart',
    enddate: 'lastmonthend'
    },
    {
    content: '1 hour',
    startdate: '-1h',
    enddate: 'now'
    },
    {
    content: '4 hour',
    startdate: '-4h',
    enddate: 'now'
    },
    {
    content: '8 hour',
    startdate: '-8h',
    enddate: 'now'
    },
    {
    content: '1 day',
    startdate: '-1d',
    enddate: 'now'
    },
    {
    content: '3 days',
    startdate: '-3d',
    enddate: 'now'
    },
    {
    content: '7 days',
    startdate: '-7d',
    enddate: 'now'
    },
    {
    content: '14 days',
    startdate: '-14d',
    enddate: 'now'
    },
    {
    content: '30 days',
    startdate: '-30d',
    enddate: 'now'
    },
    ]

Best regards,
Gabor Balazs
head of Selected Solution Management Ltd. development
src.zip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant