ESI provides both sickness benefit, i.e. medical treatment during pregnancy as well as maternity benefit i.e., ESIC provides 100% of average daily wages in cash up to 26 weeks in confinement . ESI benefit is conditioned on the basis of the compliance during the contribution period. The table below gives the position. Since you are seeking the benefit during Jan to June 2018 period, it would depend on whether you had contributed to ESI during April to September '17 contribution period. The benefit period is not dependent on the service period, it can exceed it. So also, as you are contributing in Oct 17 to March '18 contribution period , your beneficiary period would extend to December 2018.
Contribution period Corresponding benefit period
1st April to 30 September following 1st January to 30th June of the year
1st October to 31st March following 1st July to 31st December of the year