Questions tagged [android-datepicker]

Android DatePicker is a widget for selecting a date. The date can be selected by a year, month, and day spinners or a CalendarView. The set of spinners and the calendar view are automatically synchronized.

Android DatePicker is a widget for selecting a date. The date can be selected by a year, month, and day spinners or a CalendarView. The set of spinners and the calendar view are automatically synchronized.

Android DatePickerDialog is a dialog that hosts a DatePicker widget.

786 questions
-1
votes
3 answers

How to show the Calender of only one year from current date in Android?

I want that the calender show user only one year date and rest will be disabled for the past it is working fine .But now i want to make so that the user can select only one year calender from current date.here is my code .Please suggest me the…
Developer
  • 6,292
  • 19
  • 55
  • 115
-1
votes
1 answer

DatePicker with Date Only

I want to get a date data from a form but only the date, not including the month nor the year. Can I use datepicker in the form but with the date only? If it's not possible, what the efficient way to get date information from a form ? Thanks
-1
votes
5 answers

How to set and save date in Android SQLite?

I am trying to create a TaskManager Where I have a setDate Button, When I click on SetDate Button it passed me on next Activity where I placed a DatePicker in the layout. I am trying to set date and then passing that set date into the database using…
Shweta
  • 1,145
  • 5
  • 18
  • 35
-1
votes
4 answers

Validating the Date of birth field in Android

In my application i have a date of birth field which i need to validate... The validate condition is that the user should not select the current date and if selected it show an error message... The date is being selected from a DatePickerDialog in…
-1
votes
3 answers

Change date displayed in button to DDth MMMM YY but keep values as DD/MM

I am using a DatePicker so that the user can select a date and find out the sunrise and sunset times for that particular date. The webservice I am using requires the date to be snet in the following format dd/MM but I would like the button to show…
Athoul
  • 61
  • 2
  • 11
-2
votes
1 answer

MaterialDatePicker.getHeaderText() returns 00 on month android

i have a material date picker which i want to use to get a date my problem is when i try to format it to 'yyyy-mm-dd' it always returns "00" in months for example if a string "Mar 5,2021" the result will be "2021-00-05" any help will be appreciated…
-2
votes
2 answers

Convert Date format getting from DatePickerDialog to yyyy-MM-dd

I want to convert the date format to yyyy-MM-dd i am getting from the DatePickerDialog and storing the date in editext, and retrieving the date into string, the date i am getting in String is in the format of mm-dd-yyyy public class MainActivity…
Shubham
  • 75
  • 2
  • 11
-2
votes
2 answers

How to insert date in SqLite Database in android with datepicker

I am new in android. I have created a date picker. But i could not insert date into the database. I tried as: SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd"); String formattedDate =…
Fatema
  • 41
  • 1
  • 2
  • 9
-2
votes
1 answer

How to check if startTime and startDate is less than endTime and endDate?

I'm developing an app in which I want to check if startTime and startDate is less than endTime and endDate and if it is then only the information should be saved in FirebaseDatabase. I'm using this code to check is startTime < endTime and startDate…
-2
votes
1 answer

Error in Datepicker on Android

I'm trying to open a dialog for picking a date on Android. Here is my code : et_date = (EditText) findViewById(R.id.et_date); et_date.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { …
jason
  • 6,962
  • 36
  • 117
  • 198
-2
votes
1 answer

Check is sunday from datepicker dialog

Hi I'm new to android i'm doing one project in my project i want to check is sunday from selected date in datepicker dialog please help me
-2
votes
3 answers

how to get number of years between two dates in android

hello i am creating an android app in which i have two string of different dates now i want to get number of years between these dates anyone please help me how i can do this? here is my code String …
John
  • 15
  • 1
  • 6
-2
votes
1 answer

android set time in datetime picker using milliseconds

I have a time in milliseconds say 1384841520328, i need to convert and set in datepicker and timepicker, i converted the time from datetime picker as, Calendar calendar = Calendar.getInstance(); calendar.set(datePicker.getYear(),…
Irfan Ahmed
  • 9,136
  • 8
  • 33
  • 54
-3
votes
2 answers

NullPointerException when setting Date in Android app

I am following this tutorial for implementing date and time on edit text click. public class LoadActivity extends AppCompatActivity { @SuppressLint("StaticFieldLeak") static EditText DateEdit; @Override protected void onCreate(Bundle…
-3
votes
1 answer

How to set minimum date for "ToDate" on datepicker as per the "FromDate" i chosed on another datepicker

In brief, I have two date pickers (From, To). Where I choose "FromDate" and "ToDate" up to the current date. If I choose 2019-04-04 to "FromDate" and when I choose "ToDate", it should hide the dates which are before "FromDate". How can I achieve…
Abhishek
  • 19
  • 7
1 2 3
52
53