In my activity I have 2 Datepicker with which I choose the starting date (for example 01/01/2014) and end date (for example 12/01/2014). then I have to insert 12 records at the same time with their dates, that is, in my date field there will be the following lines:
01/01/2014
01/02/2014
01/03/2014
01/04/2014
01/05/2014
01/06/2014
01/07/2014
01/08/2014
01/09/2014
01/10/2014
01/11/2014
01/12/2014
until now have only been able to calculate the difference between the starting date and the ending date, but I do not know exactly how to put all those records together. Thanks for your help.
my code to calculate the difference between dates (JodaTime)
public void diff_date(View v){
SimpleDateFormat sdf = new SimpleDateFormat( "yyyy-MM-dd" );
String date_in = sdf.format( dateAndTime.getTime() );
String date_out = sdf.format( dateAndTime1.getTime() );
int differenza_date = Days.daysBetween(new DateTime(date_in), new DateTime(date_out)).getDays();