How do I restrict the working time to week days, I don't want the bars to go through the weekends
Hmmm. In my experience, the bars go through the weekends so that you can see the total number of days the task takes. If you had the bars end, it would appear the task stops and starts multiple times and wouldn't provide a quick glance of time on task. Granted, you don't work on the weekends, but the project is still in that stage or task throughout the weekend, even if its not being worked on. I'm not sure of a way of changing that. Perhaps another community member does.
Do be aware that the duration column is excluding weekends if you have them set up in your Account > Account Administration settings page (see screenshot).