Time formatting fixed
This commit is contained in:
parent
f390ceac2b
commit
44368bc1c8
@ -7,6 +7,7 @@ import android.app.ProgressDialog;
|
|||||||
import android.app.TimePickerDialog;
|
import android.app.TimePickerDialog;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.SharedPreferences;
|
import android.content.SharedPreferences;
|
||||||
|
import android.content.SyncAdapterType;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.os.PersistableBundle;
|
import android.os.PersistableBundle;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
@ -277,18 +278,19 @@ public class PermissionRequestActivity extends AppCompatActivity {
|
|||||||
int minute) {
|
int minute) {
|
||||||
|
|
||||||
timeset="";
|
timeset="";
|
||||||
|
System.out.println("hourOfDay : " + hourOfDay);
|
||||||
if(hourOfDay>12)
|
if(hourOfDay>12)
|
||||||
{
|
{
|
||||||
hourOfDay-=12;
|
hourOfDay-=12;
|
||||||
timeSetFrom="PM";
|
timeSetFrom="PM";
|
||||||
}
|
}
|
||||||
else if(hourOfDay==0)
|
else
|
||||||
{
|
{
|
||||||
hourOfDay+=12;
|
|
||||||
timeSetFrom="AM";
|
timeSetFrom="AM";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
textTimeFrom.setText(hourOfDay + ":" + minute + " " + timeSetFrom);
|
textTimeFrom.setText(hourOfDay + ":" + minute + " " + timeSetFrom);
|
||||||
}
|
}
|
||||||
}, mHour, mMinute, false);
|
}, mHour, mMinute, false);
|
||||||
@ -325,12 +327,12 @@ public class PermissionRequestActivity extends AppCompatActivity {
|
|||||||
hourOfDay-=12;
|
hourOfDay-=12;
|
||||||
timeset="PM";
|
timeset="PM";
|
||||||
}
|
}
|
||||||
else if(hourOfDay==0)
|
else
|
||||||
{
|
{
|
||||||
hourOfDay+=12;
|
|
||||||
timeset="AM";
|
timeset="AM";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
textTimeTo.setText(hourOfDay + ":" + minute+" "+timeset);
|
textTimeTo.setText(hourOfDay + ":" + minute+" "+timeset);
|
||||||
}
|
}
|
||||||
}, mHour, mMinute, false);
|
}, mHour, mMinute, false);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user