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

Date Picker is showing wrong date #35

Open
Anandsanjay opened this issue Jun 8, 2021 · 3 comments
Open

Date Picker is showing wrong date #35

Anandsanjay opened this issue Jun 8, 2021 · 3 comments

Comments

@Anandsanjay
Copy link

We are using holo datepicker to select dates and then adding them to the database. There is an error while selecting the date. it is always showing 7 months prior to the date selected.

this is our date picker code:
DatePickerWidget(
looping: true, // default is not looping
firstDate: DateTime.now(), //DateTime(1960),
dateFormat: "dd-MMMM-yyyy",
// locale: DatePicker.localeFromString('he'),
onChange: (DateTime newDate, _) {
setState(() => dateTime = newDate);
print(dateTime);
},
pickerTheme: DateTimePickerTheme(
itemTextStyle: TextStyle(color: Colors.black, fontSize: 19),
// dividerColor: Colors.blue,
),
),

the code below is to add it in the data base:
firestore.collection('UserCollection')
.doc(_auth.currentUser.uid)
.collection('Products')
.doc(data.docs[0].data()['categoryID'])
.update({
'Items': FieldValue.arrayUnion([
{
'ItemName': item_Name_Controller.text,
'expiryDate': dateTime,
}
])
});

@kfiross
Copy link
Owner

kfiross commented Jun 23, 2021

Hi @Anandsanjay , can you attach please a screenshot?

@AimanKyo97
Copy link

AimanKyo97 commented Sep 30, 2021

Hi @kfiross i got same issue, just follow the code from pub.dev but when show it show first date it show middle one which is for future date not date now

@kfiross
Copy link
Owner

kfiross commented Oct 3, 2021

Hi
There is a bug introduced with a new version of Flutter?

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

3 participants