As you know, the Prime Minister has 180 days to call a by-election. If he were to call the by-election before royal assent, then the new legislation would not apply. If he were to call it after, then it would apply.
On May 28th, 2018. See this statement in context.