I'm working on a D&D campaign where a town is stuck in a time loop. my players can do whatever and the day doesn't repeat exactly; every day is a different day, the sun revolves around the planet and monday ends and tuesday begins, but the townsfolk are stuck doing the exact things they did the day they were cursed and are trapped repeating what they did over and over until the curse/enchantment/spell is broken. The townspeople are unable to interact with the players.
Is there any monster or item, homebrewed or official, that could trap a large group of people in a time loop? I've looked everywhere and I can't find what i'm looking for so far.
The players are at level 2.