(a)
(1) When any sheriff or other law enforcement officer makes an arrest, he or she is authorized to take and to approve bail in the manner provided by law wherever he or she makes the arrest.
(2) If the offense charged is a misdemeanor, the person arrested may immediately give bail for appearing on a day to be named in the bail bond before the judge or magistrate who issued the warrant or before the court having jurisdiction to try the offense. The sheriff or other officer making the arrest may be authorized by the judge or magistrate issuing the warrant to take the bail by an endorsement made on the warrant to that effect.
(b)
(1) If the defendant gives bail for his or her appearance before the judge or magistrate for an examination of the charge, as provided in subsection (a) of this section, the sheriff or officer taking the bail shall fix the day of the defendant's appearance.
(2) A deviation from the provisions of subdivision (b)(1) of this section shall not, however, render the bail bond invalid.