How do we reason the seven days of the Israelites walking around Jericho, knowing that Israelites were commanded to keep the Sabbath?
I would say the same reason the disciples were picking grain on the sabbath with Jesus and when David ate the bread from the temple. There are more important matters and while some violations of the law are violations they are not moral violations. Jesus also is Lord over the sabbath so it was not sin.
Lord of the Sabbath
23 Jesus was going through the grain fields on a Sabbath, and his disciples began to pick some heads of wheat as they made their way. 24 So the Pharisees said to him, “Look, why are they doing what is against the law on the Sabbath?” 25 He said to them, “Have you never read what David did when he was in need and he and his companions were hungry— 26 how he entered the house of God when Abiathar was high priest and ate the sacred bread, which is against the law for any but the priests to eat, and also gave it to his companions?” 27 Then he said to them, “The Sabbath was made for people, not people for the Sabbath. 28 For this reason the Son of Man is lord even of the Sabbath.”
So in Joshua, my question would be was walking around Jericho a command from the Lord?
If it was then it’s not a contradiction to the Law since God is Lord over the Sabbath.
There is no law in the Bible against a Jew walking on the Sabbath. Long after Joshua’s time, the Pharisees fabricated prohibitions about how far one could walk on the Sabbath, but that was never ordered by God.
Actually, your question would make a very good conundrum for a Pharisee!
Walking was not prohibited on a Sabbath day. It was limited as mentioned by brother James Lyons. Even today rocks on the roadsides indicating the limit of a Sabbath day journey can be seen.