(a) In an eviction action, the court, in its discretion, may grant a continuance of the trial for no more than six days unless all parties consent to longer continuance.
(b) However, in all actions brought under section 504B.285, other than actions on a written lease signed by both parties, the court shall continue the trial as necessary but for no more than three months if the defendant or the defendant's agent or attorney:
(1) states under oath that the defendant cannot proceed to trial because a material witness is not present;
(2) names the witness;
(3) states under oath that the defendant has made due exertion to obtain the witness;
(4) states the belief that if the continuance is allowed the defendant will be able to procure the attendance of the witness at the trial or to obtain the witness's deposition; and
(5) gives a bond that the plaintiff will be paid all rent that accrues during the pendency of the action and all costs and damages that accrue due to the adjournment.