Closed RAMSHEER closed 6 years ago
yes. it is possible. You are in control of your own cell. You can design it however you want. The exact same way you'd design an islamic/gregorian design for a UICollectionView or a UITableView, is the same way you'd design it for this library
but when we are giving date data to the cells, ie; " cell.dateLabel.text = cellState.text " . In the cellstate we are describing one calender either islamic or gregorian.. then how we will be able to add another Calender in cellstate and add to another label?? ie; "cell.datelabel2.text = cellstate.text" will not give the next calender details ..
You can design the cell however you want. In the example you mentioned above, you have one label.
cell.dateLabel.text = cellState.text
Why not put 2 labels on the cell instead of one? You can even put 3 labels, or 4,5....10000. :) The design is entirely up to you.
Do you know how to design your cell? ( I assume you have already watched the videos?)
yes. i already created an islamic calender..bt i need corresponding gregorian date in the same cell. cell.dateLabel.text = cellState.text this is how i set the datelabel text.. And my question is When i am adding another label for gregorian dates , say "gregDateLAbel".. how can i set the gregDAteLAbel text ??? gregDateLAbel.text = cellState.text will not give the results ..it will display one calender details only
@RAMSHEER can you join me here? https://gitter.im/patchthecode/JTAppleCalendar
let myCalendar = Calendar(...... // create a islamic calendar here)
let dateFormatter = DateFormatter()
dateFormater.calendar = myCalendar
let date = cellState.date
let islamicTextDate = dateFormatter.string(from: date)
you can use this strategy to create dates in any language
Note: please do not create the Calendar and the DateFormatter inside of the cellForItem function. These classes are HEAVY, and will mess with your performance if you place them in there
closing this issue, let me know if you have any other questions.
IMPORTANT - BEFORE CREATING YOUR ISSUE PLEASE READ THE FOLLOWING: