| | |
| | | import android.text.TextUtils; |
| | | |
| | | import com.hdl.photovoltaic.config.UserConfigManage; |
| | | import com.hdl.photovoltaic.enums.Languages; |
| | | import com.hdl.photovoltaic.enums.TimeType; |
| | | import com.hdl.photovoltaic.other.HdlThreadLogic; |
| | | import com.hdl.photovoltaic.ui.home.HomePageFragment; |
| | |
| | | String pattern = "yyyy-MM-dd HH:mm:ss"; |
| | | if (isDisplaySeconds) { |
| | | pattern = "yyyy-MM-dd HH:mm:ss"; |
| | | if (UserConfigManage.getInstance().getCurrentAppLanguage().equals(LocalManageUtil.en)) { |
| | | if (UserConfigManage.getInstance().getCurrentAppLanguage().equals(Languages.en)) { |
| | | pattern = "dd-MM-yyyy HH:mm:ss"; |
| | | } |
| | | } else { |
| | | pattern = "yyyy-MM-dd HH:mm"; |
| | | if (UserConfigManage.getInstance().getCurrentAppLanguage().equals(LocalManageUtil.en)) { |
| | | if (UserConfigManage.getInstance().getCurrentAppLanguage().equals(Languages.en)) { |
| | | pattern = "dd-MM-yyyy HH:mm"; |
| | | } |
| | | } |
| | |
| | | public static String getTimeFromTimestamp(long timestamp) { |
| | | try { |
| | | String pattern = "yyyy-MM-dd HH:mm"; |
| | | if (UserConfigManage.getInstance().getCurrentAppLanguage().equals(LocalManageUtil.en)) { |
| | | if (UserConfigManage.getInstance().getCurrentAppLanguage().equals(Languages.en)) { |
| | | pattern = "dd-MM-yyyy HH:mm"; |
| | | } |
| | | SimpleDateFormat dateFormat = new SimpleDateFormat(pattern, getLocale()); |
| | |
| | | public static String getDataFromTimestamp(long timestamp) { |
| | | try { |
| | | String pattern = "MM-dd"; |
| | | if (UserConfigManage.getInstance().getCurrentAppLanguage().equals(LocalManageUtil.en)) { |
| | | if (UserConfigManage.getInstance().getCurrentAppLanguage().equals(Languages.en)) { |
| | | pattern = "dd-MM"; |
| | | } |
| | | SimpleDateFormat dateFormat = new SimpleDateFormat(pattern, getLocale()); |