Giter Site home page Giter Site logo

Comments (13)

mrwwalmsley avatar mrwwalmsley commented on August 16, 2024 2

Sorry for the late reply, I'm just getting on to implementing this functionality, and it doesn't seem to be working as I would like.

I want to set the current date to today... but allow the user to scroll back to select a day in the past.

The calendar timeline always starts on the current date.

See line 58 in date_picker_timeline.dart
DateTime _date = DateTime.now().add(Duration(days: index));

from datepickertimelineflutter.

iamvivekkaushik avatar iamvivekkaushik commented on August 16, 2024 1

Hi @mrwwalmsley, if you want the date to start at some previous time, then you can just pass that date to the constructor.

DatePickerTimeline(
  DateTime.now(),
  onDateChange: (date) {
    // New date selected
    print(date.day.toString());
  },
),

Instead of date.now() you can pass any date and the calendar will start from that particular date.

from datepickertimelineflutter.

iamvivekkaushik avatar iamvivekkaushik commented on August 16, 2024

Hi @mrwwalmsley, can you confirm if this resolves your issue?

from datepickertimelineflutter.

iamvivekkaushik avatar iamvivekkaushik commented on August 16, 2024

I am closing this issue.

from datepickertimelineflutter.

hinterlandcreative avatar hinterlandcreative commented on August 16, 2024

Any update on this? Can this PR #12 get merged in please?

from datepickertimelineflutter.

iamvivekkaushik avatar iamvivekkaushik commented on August 16, 2024

I had no time to implement this, #12 have it implemented, you can use that version until it gets merged.

dependencies:
  date_picker_timeline:
    git:
      url: https://github.com/psygo/DatePickerTimelineFlutter.git

from datepickertimelineflutter.

HannHank avatar HannHank commented on August 16, 2024

I tried to pass the date like this DateTime.now().add(Duration(days: -10) to get the last week, but still see future dates.

from datepickertimelineflutter.

Mallington avatar Mallington commented on August 16, 2024

@HannHank Did you find a fix for this?

from datepickertimelineflutter.

HannHank avatar HannHank commented on August 16, 2024

@Mallington nope, still facing that problem.

from datepickertimelineflutter.

Mallington avatar Mallington commented on August 16, 2024

@HannHank I have posted a fix here: https://github.com/Mallington/DatePickerTimelineFlutter. You can modify your pubspec.yaml to use:

date_picker_timeline:
      git:
        url: https://github.com/Mallington/DatePickerTimelineFlutter

I'd recommend forking the repository for long term use, just in case I delete it 😄

from datepickertimelineflutter.

HannHank avatar HannHank commented on August 16, 2024

@Mallington thanks 👍

from datepickertimelineflutter.

Mallington avatar Mallington commented on August 16, 2024

@HannHank There was an issue with my original commit. I have moved to setting the startDate in the constructor
See Example:

DatePickerTimeline(
   DateTime.now().add(Duration(days: -10)),
         onDateChange: (date) {
           // New date selected
           print(date.day.toString());
         },
         startDate: DateTime.now().add(Duration(days: -10)),
         daysCount: 10,
       )

from datepickertimelineflutter.

iamvivekkaushik avatar iamvivekkaushik commented on August 16, 2024

Hi everyone, this option is now added to the library, just specify the startDate and the calendar will start from that particular date. I have also added a controller to move to any specific date.

from datepickertimelineflutter.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.