There is actually no time limit specified under the law for generating an e-way bill. however, it requires the registered person to have legally generated e-way bill in either physical or electronic form while making the movement of goods. so irrespective of the date of invoice e-way bill could be generated on the date when the goods are to be moved out for delivery.
Further section 129 of CGST act deals with penalty in case of detention of vehicle on a account of improper documents (including e-way bill). under the said section, a Registered person can have it's goods released after the payment of tax applicable on such goods along with a penalty equals to 100% of tax payable on goods.