years. This is not correct. The ruling [of 2 years] applies only to breastfeeding. As for Nikah being Ḥarām, the period is two and a half years. In other words, although it is Ḥarām to breastfeed a baby after two years, Ḥurmat-un-Nikāḥ [prohibition on Nikah] will still be valid if she breastfeeds the baby within two and a half Ĥijrī years. However, if she feeds the baby after two and a half years, which is not permissible, Ḥurmat-un-Nikah will not be valid [i.e. Nikah will not be Ḥarām].
Sayyidunā ‘Abdullāĥ Bin ‘Abbās رَضِىَ الـلّٰـهُ تَـعَالٰی عَـنْهُمَا has stated that the Holy Prophet صَلَّى اللهُ تَعَالٰى عَلَيْهِ وَاٰلِهٖ وَسَلَّم has said, ‘The one who is obedient to his parents in the morning, two doors of Paradise get opened for him in the morning, and if only one parent [is alive], then one door opens. And the one who is disobedient to Allah عَزَّوَجَلَّ regarding his parents in the evening, two doors of Hell get opened for him in the morning, and if only one of them [is alive], then only one door opens.’ A person asked, ‘Even if the parents oppress him.’ He صَلَّى اللهُ تَعَالٰى عَلَيْهِ وَاٰلِهٖ وَسَلَّم replied, ‘Even if they oppress, even if they oppress, even if they oppress.’
(Shu’ab-ul-Īmān, vol. 6, pp. 206, Ḥadīš 7916)
Dear Islamic brothers! The person who keeps his parents happy is very fortunate indeed. The one who displeases his parents will end up with destructiveness. Allah عَزَّوَجَلَّ has said in Sūraĥ Banī Isrāīl, part 15, verse 23 to 25: