The HTC One M8 now comes with a Do Not Disturb mode. When enabled, the new mode will prevent your phone from making any noise, vibrating, and keep the indicator light turned off. You can set DND to follow a schedule, or enable it before a meeting.
Customize DND by launching the Settings app, going to Sounds and selecting Do Not Disturb from the list of options. Here you can set a schedule and add contact exceptions.