mirror of
https://github.com/etesync/android
synced 2024-11-22 16:08:13 +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!!)!!
|
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)
|
App.log.info("Synchronizing calendar #" + calendar.id + ", URL: " + calendar.name)
|
||||||
val syncManager = CalendarSyncManager(context, account, settings, extras, authority, syncResult, calendar, principal)
|
val syncManager = CalendarSyncManager(context, account, settings, extras, authority, syncResult, calendar, principal)
|
||||||
syncManager.performSync()
|
syncManager.performSync()
|
||||||
@ -118,7 +118,7 @@ class CalendarsSyncAdapterService : SyncAdapterService() {
|
|||||||
remote[journalEntity.uid] = journalEntity
|
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
|
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 entry = SyncEntry(local.content, action)
|
||||||
val tmp = JournalEntryManager.Entry()
|
val tmp = JournalEntryManager.Entry()
|
||||||
tmp.update(crypto, entry.toJson(), previousEntry!!)
|
tmp.update(crypto, entry.toJson(), previousEntry)
|
||||||
previousEntry = tmp
|
previousEntry = tmp
|
||||||
localEntries!!.add(previousEntry)
|
localEntries!!.add(previousEntry)
|
||||||
|
|
||||||
|
@ -314,11 +314,11 @@ class JournalItemActivity : BaseActivity(), Refreshable {
|
|||||||
|
|
||||||
// ANNIVERSARY
|
// ANNIVERSARY
|
||||||
if (contact.anniversary != null) {
|
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
|
// BDAY
|
||||||
if (contact.birthDay != null) {
|
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
|
// 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) {
|
if (date != null) {
|
||||||
val epochDate = date.time
|
val epochDate = date.time
|
||||||
return getDisplayedDatetime(epochDate, epochDate, true, context)
|
return getDisplayedDatetime(epochDate, epochDate, true, context)
|
||||||
} else {
|
} else if (partialDate != null){
|
||||||
val formatter = SimpleDateFormat("d MMMM", Locale.getDefault())
|
val formatter = SimpleDateFormat("d MMMM", Locale.getDefault())
|
||||||
val calendar = GregorianCalendar()
|
val calendar = GregorianCalendar()
|
||||||
calendar.set(Calendar.DAY_OF_MONTH, partialDate.date!!)
|
calendar.set(Calendar.DAY_OF_MONTH, partialDate.date!!)
|
||||||
calendar.set(Calendar.MONTH, partialDate.month!! - 1)
|
calendar.set(Calendar.MONTH, partialDate.month!! - 1)
|
||||||
return formatter.format(calendar.time)
|
return formatter.format(calendar.time)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return null
|
||||||
}
|
}
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
|
Loading…
Reference in New Issue
Block a user