(a) When a defendant is sentenced or committed for a term of one year or less by a court of record having criminal jurisdiction, the court may in its order grant to the defendant the privilege of leaving the jail during necessary and reasonable hours for any of the following purposes:
(1) To work at his or her employment;