NSP
NSP

Reputation: 31

how to get current displaying page month in string in Fscalender in swift

I know how to get the month of current page but I want to know how to get the month of current page in string in fscalender please help me I'm new to iOS.

let values = Calendar.current.dateComponents([Calendar.Component.month, Calendar.Component.year], from: self.fscalenderobj.currentPage) 
var CURRENT_MONTH = values.month 

it's in integer form like in today month -> 5 ,I want it in name like May.

Upvotes: 1

Views: 69

Answers (1)

Rajesh Budhiraja
Rajesh Budhiraja

Reputation: 192

It's pretty simple.

let monthSymbols = Calendar.current.shortMonthSymbols (or monthSymbols dependeing upon what you need)

You can refer this https://developer.apple.com/documentation/foundation/calendar/2293753-shortmonthsymbols

Upvotes: 1

Related Questions