The star formation history of the Large Magellanic Cloud star clusters NGC 1846 and NGC 1783