sunrise debug display in ISO8601 without seconds

This commit is contained in:
sonora 2012-09-04 11:32:46 +02:00
parent b5cebe9a6b
commit f2c16a1794

View file

@ -1,6 +1,5 @@
package net.osmand.plus.development;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import net.osmand.SunriseSunset;
@ -131,20 +130,13 @@ public class OsmandDevelopmentPlugin extends OsmandPlugin {
pref = new Preference(app);
pref.setTitle(R.string.day_night_info);
if (sunriseSunset != null) {
//SimpleDateFormat prt = new SimpleDateFormat("dd.MM.yyyy HH:mm");
//pref.setSummary(activity.getString(R.string.day_night_info_description, prt.format(sunriseSunset.getSunrise()),
// prt.format(sunriseSunset.getSunset())));
//new approach for previous 3 lines from Issue 1313
DateFormat format = SimpleDateFormat.getDateTimeInstance();
String sunrise = format.format(sunriseSunset.getSunrise());
String sunset = format.format(sunriseSunset.getSunset());
pref.setSummary(activity.getString(R.string.day_night_info_description, sunrise, sunset));
SimpleDateFormat prt = new SimpleDateFormat("yyyy-MM-dd HH:mm");
pref.setSummary(activity.getString(R.string.day_night_info_description, prt.format(sunriseSunset.getSunrise()),
prt.format(sunriseSunset.getSunset())));
} else {
pref.setSummary(activity.getString(R.string.day_night_info_description, "null",
"null"));
}
cat.addPreference(pref);
cat.addPreference(pref);
}
}