You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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,
}
])
});
The text was updated successfully, but these errors were encountered:
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
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,
}
])
});
The text was updated successfully, but these errors were encountered: