filter bug fix
This commit is contained in:
parent
ed12d47941
commit
5c453f7dff
|
@ -38,7 +38,7 @@ public class FilterUpdate implements Serializable {
|
|||
* @param filter existing filter
|
||||
*/
|
||||
public FilterUpdate(Filter filter) {
|
||||
int expires_at = (int) (filter.getExpirationTime() - System.currentTimeMillis());
|
||||
int expires_at = (int) ((filter.getExpirationTime() - System.currentTimeMillis()) / 1000L);
|
||||
Keyword[] keywords = filter.getKeywords();
|
||||
id = filter.getId();
|
||||
title = filter.getTitle();
|
||||
|
|
|
@ -36,7 +36,7 @@ public interface Filter extends Serializable {
|
|||
/**
|
||||
* get date time where the filter expires
|
||||
*
|
||||
* @return date time or '0' if not defined
|
||||
* @return ISO 8601 Datetime or '0' if not defined
|
||||
*/
|
||||
long getExpirationTime();
|
||||
|
||||
|
|
|
@ -129,14 +129,14 @@ public class FilterDialog extends Dialog implements OnClickListener, OnCheckedCh
|
|||
sw_thread.setCheckedImmediately(update.filterThreadSet());
|
||||
sw_hide.setCheckedImmediately(update.getFilterAction() == Filter.ACTION_HIDE);
|
||||
txt_title.setText(update.getTitle());
|
||||
if (update.getExpirationTime() > 86400000L) {
|
||||
txt_duration.setText(Long.toString(Math.round(update.getExpirationTime() / 86400000d)));
|
||||
if (update.getExpirationTime() > 86400) {
|
||||
txt_duration.setText(Long.toString(Math.round(update.getExpirationTime() / 86400d)));
|
||||
timeunit.setSelection(2);
|
||||
} else if (update.getExpirationTime() > 3600000L) {
|
||||
txt_duration.setText(Long.toString(Math.round(update.getExpirationTime() / 3600000d)));
|
||||
} else if (update.getExpirationTime() > 3600) {
|
||||
txt_duration.setText(Long.toString(Math.round(update.getExpirationTime() / 3600d)));
|
||||
timeunit.setSelection(1);
|
||||
} else if (update.getExpirationTime() > 60000L) {
|
||||
txt_duration.setText(Long.toString(Math.round(update.getExpirationTime() / 60000d)));
|
||||
} else if (update.getExpirationTime() > 60) {
|
||||
txt_duration.setText(Long.toString(Math.round(update.getExpirationTime() / 60d)));
|
||||
timeunit.setSelection(0);
|
||||
} else {
|
||||
timeunit.setSelection(2);
|
||||
|
|
Loading…
Reference in New Issue