From 8088290cf9d8fa01f734a7080d7e04529b25fdaa Mon Sep 17 00:00:00 2001 From: Chumva Date: Thu, 18 Oct 2018 18:06:25 +0300 Subject: [PATCH] Fix #6141 --- .../main/java/net/osmand/util/OpeningHoursParser.java | 11 +++++++++++ .../net/osmand/plus/osmedit/BasicEditPoiFragment.java | 3 +++ 2 files changed, 14 insertions(+) diff --git a/OsmAnd-java/src/main/java/net/osmand/util/OpeningHoursParser.java b/OsmAnd-java/src/main/java/net/osmand/util/OpeningHoursParser.java index 723ed50128..2159d41382 100644 --- a/OsmAnd-java/src/main/java/net/osmand/util/OpeningHoursParser.java +++ b/OsmAnd-java/src/main/java/net/osmand/util/OpeningHoursParser.java @@ -1196,6 +1196,17 @@ public class OpeningHoursParser { return false; } + public boolean isOpenedEveryDay() { + boolean openedEveryDay = true; + for (int i = 0; i < 7; i++) { + if (!days[i]) { + openedEveryDay = false; + break; + } + } + return openedEveryDay; + } + @Override public String getTime(Calendar cal, boolean checkAnotherDay, int limit, boolean opening) { StringBuilder sb = new StringBuilder(); diff --git a/OsmAnd/src/net/osmand/plus/osmedit/BasicEditPoiFragment.java b/OsmAnd/src/net/osmand/plus/osmedit/BasicEditPoiFragment.java index f476a7528a..4c52132564 100644 --- a/OsmAnd/src/net/osmand/plus/osmedit/BasicEditPoiFragment.java +++ b/OsmAnd/src/net/osmand/plus/osmedit/BasicEditPoiFragment.java @@ -148,6 +148,9 @@ public class BasicEditPoiFragment extends BaseOsmAndFragment } public void setBasicOpeningHoursRule(BasicOpeningHourRule item, int position) { + if (item.getStartTime() == 0 && item.getEndTime() == 0 && item.isOpenedEveryDay()) { + item.setEndTime(24 * 60); + } mOpeningHoursAdapter.setOpeningHoursRule(item, position); }