mirror of
https://github.com/etesync/android
synced 2024-11-21 23:48:11 +00:00
snap
This commit is contained in:
parent
576fb262a7
commit
ad4f92deef
@ -68,7 +68,7 @@ class CalendarsSyncAdapterService : SyncAdapterService() {
|
||||
|
||||
val principal = HttpUrl.get(settings.uri!!)!!
|
||||
|
||||
for (calendar in AndroidCalendar.find(account, provider, LocalCalendar.Factory, CalendarContract.Calendars.SYNC_EVENTS + "!=0", null) as Array<LocalCalendar>) {
|
||||
for (calendar in AndroidCalendar.find(account, provider, LocalCalendar.Factory, CalendarContract.Calendars.SYNC_EVENTS + "!=0", null)) {
|
||||
App.log.info("Synchronizing calendar #" + calendar.id + ", URL: " + calendar.name)
|
||||
val syncManager = CalendarSyncManager(context, account, settings, extras, authority, syncResult, calendar, principal)
|
||||
syncManager.performSync()
|
||||
@ -118,7 +118,7 @@ class CalendarsSyncAdapterService : SyncAdapterService() {
|
||||
remote[journalEntity.uid] = journalEntity
|
||||
}
|
||||
|
||||
val local = AndroidCalendar.find(account, provider, LocalCalendar.Factory, null, null) as Array<LocalCalendar>
|
||||
val local = AndroidCalendar.find(account, provider, LocalCalendar.Factory, null, null)
|
||||
|
||||
val updateColors = settings.manageCalendarColors
|
||||
|
||||
|
@ -448,7 +448,7 @@ constructor(protected val context: Context, protected val account: Account, prot
|
||||
|
||||
val entry = SyncEntry(local.content, action)
|
||||
val tmp = JournalEntryManager.Entry()
|
||||
tmp.update(crypto, entry.toJson(), previousEntry!!)
|
||||
tmp.update(crypto, entry.toJson(), previousEntry)
|
||||
previousEntry = tmp
|
||||
localEntries!!.add(previousEntry)
|
||||
|
||||
|
@ -314,11 +314,11 @@ class JournalItemActivity : BaseActivity(), Refreshable {
|
||||
|
||||
// ANNIVERSARY
|
||||
if (contact.anniversary != null) {
|
||||
addInfoItem(view.context, aboutCard, getString(R.string.journal_item_anniversary), null, getDisplayedDate(contact.anniversary?.date, contact.anniversary?.partialDate!!))
|
||||
addInfoItem(view.context, aboutCard, getString(R.string.journal_item_anniversary), null, getDisplayedDate(contact.anniversary?.date, contact.anniversary?.partialDate))
|
||||
}
|
||||
// BDAY
|
||||
if (contact.birthDay != null) {
|
||||
addInfoItem(view.context, aboutCard, getString(R.string.journal_item_birthday), null, getDisplayedDate(contact.birthDay?.date, contact.birthDay?.partialDate!!))
|
||||
addInfoItem(view.context, aboutCard, getString(R.string.journal_item_birthday), null, getDisplayedDate(contact.birthDay?.date, contact.birthDay?.partialDate))
|
||||
}
|
||||
|
||||
// RELATED
|
||||
@ -333,17 +333,19 @@ class JournalItemActivity : BaseActivity(), Refreshable {
|
||||
}
|
||||
}
|
||||
|
||||
private fun getDisplayedDate(date: Date?, partialDate: PartialDate): String? {
|
||||
private fun getDisplayedDate(date: Date?, partialDate: PartialDate?): String? {
|
||||
if (date != null) {
|
||||
val epochDate = date.time
|
||||
return getDisplayedDatetime(epochDate, epochDate, true, context)
|
||||
} else {
|
||||
} else if (partialDate != null){
|
||||
val formatter = SimpleDateFormat("d MMMM", Locale.getDefault())
|
||||
val calendar = GregorianCalendar()
|
||||
calendar.set(Calendar.DAY_OF_MONTH, partialDate.date!!)
|
||||
calendar.set(Calendar.MONTH, partialDate.month!! - 1)
|
||||
return formatter.format(calendar.time)
|
||||
}
|
||||
|
||||
return null
|
||||
}
|
||||
|
||||
companion object {
|
||||
|
Loading…
Reference in New Issue
Block a user