If you fail to give two weeks' notice, you may violate your contract's terms, which might lead to legal action. If you have no other choice, informing your boss and giving as much notice as possible (or even working out a new arrangement) may be an option to reduce the impact.