traingenerator icon indicating copy to clipboard operation
traingenerator copied to clipboard

Let user select range of 7 days from past

Open shraddha1112 opened this issue 6 years ago • 3 comments

Ionic version: (check one with "x") [ ] 2.x [ x] 3.20.0 [ ] 4.x

Ion2-calendar mode: (check one with "x") [x ] components mode [x ] modal mode

I'm submitting a ... (check one with "x") [ ] bug report [ ] feature request [ x] help me

Current behavior:

Modal is not having event handler

Expected behavior:

I want to have calendar where user can select any range of 7 days in past. Eg: Jan 10 to Jan 17 2018 can be a valid selection range. I want to know how can I accomplish this goal? The Modal is not having event handler for 7 days cap And Component is not having canBackwardsSelected

Please help.

Steps to reproduce:

Related code:

insert short code snippets here
const options: CalendarModalOptions = {
    pickMode: 'range',
    canBackwardsSelected: true,
    title: 'RANGE',
    defaultDateRange: this.dateRange,
    color:'secondary',
    step:4
  };

Other information:

Ionic info: (run ionic info from a terminal/cmd prompt and paste output below):

insert the output from ionic info here

shraddha1112 avatar Jul 19 '18 09:07 shraddha1112

Hi @shraddha1112 @HsuanXyz , did you find any solution to that, as I also need to implement the same thing where a user can only select a maximum of 1-month range at a time.
Please Help. :)

saberprashant avatar Aug 27 '18 12:08 saberprashant

No I havent found any solution.

shraddha1112 avatar Aug 30 '18 05:08 shraddha1112

Versão iônica: (marque um com "x") [] 2.x [x] 3.20.0 [] 4.x

Modo Ion2-calendar: (marque um com "x") modo de componentes [x] [x] modo modal

Estou enviando um ... (marque um com "x") [] relatório de bug [] solicitação de recurso [x] me ajude

Comportamento atual:

Modal não possui manipulador de eventos

Comportamento esperado:

Eu quero ter um calendário onde o usuário possa selecionar qualquer intervalo de 7 dias no passado. Por exemplo: 10 a 17 de janeiro de 2018 pode ser um intervalo de seleção válido. Eu quero saber como posso cumprir esse objetivo? O Modal não está tendo um manipulador de eventos por 7 dias e o Component não está tendo canBackwardsSelected

Por favor ajude.

Passos para reproduzir:

Código relacionado:

insert short code snippets here
const options: CalendarModalOptions = {
    pickMode: 'range',
    canBackwardsSelected: true,
    title: 'RANGE',
    defaultDateRange: this.dateRange,
    color:'secondary',
    step:4
  };

Outra informação:

Informações iônicas: (execute a ionic infopartir de um prompt de terminal / cmd e cole a saída abaixo):

insert the output from ionic info here

I think you can pass it on like this using momentjs: works for me.

options: CalendarComponentOptions = {
    from: moment().subtract(365, 'days')['_d'], //Allow past selection up to this date
    to: moment().add(7, 'days')['_d'], //Allow future selection up to this date
}

damtaipu avatar Oct 10 '21 15:10 damtaipu