CPF must credit your top-up before the end of the calendar year in order to qualify for tax relief in the next Year of Assessment (which is based on the previous calendar year). The absolute latest crediting deadline is only via a paper check handed to a CPF officer at a CPF customer service office before 10:00 a.m. on the last business day of the year. AXS, e-Cashier, and other top-up channels have earlier deadlines, usually a couple business days earlier.
December 31, 2017, is a Sunday, so that will definitely be past the top-up deadline for the year.
The CPF Annual Limit does not apply to Special Account (or Retirement Account) top-ups. You can top up a Special Account all the way up to the Full Retirement Sum ($166,000 in 2017) if you wish, in one go. Tax relief is capped at $7,000.
It is possible to top up the Medisave Account, and with tax relief (and no $7,000 limit to that tax relief). Medisave top-ups must fit within the CPF Annual Limit of $37,740 (and within the Basic Healthcare Sum, which is $52,000 in 2017). Indeed, I generally recommend voluntarily topping up Medisave first, if able. But doing some of both is great. For example, if your wages are $6,000/month plus a 13th month bonus of $6,000, then your total compulsory CPF contributions (below age 55) will be $28,860 (employer plus employee). That should leave a $8,880 gap between your compulsory contributions and the CPF Annual Limit ($37,740 minus $28,860 is $8,880). Thus you would be able to top up your Medisave Account by $8,880 and your Special Account by $7,000 (or more; the amount above $7,000 without tax relief). Your total tax relief would be $15,880 for your voluntary contributions. And you could contribute another $7,000 to a spouse's Special Account. Assuming your spouse has limited worldwide income (less than $4,000), you would get another $7,000 of tax relief, for a total of $22,880 of voluntary CPF contribution-related tax relief in this example.
There is a total tax relief limit of $80,000 (including CPF compulsory contributions and other tax reliefs), and of course you can't get tax relief if you're in the zero percent tax bracket.