forked from OfficeDev/ui-fabric-android
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCalendarViewActivity.kt
28 lines (24 loc) · 1019 Bytes
/
CalendarViewActivity.kt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License.
*/
package com.microsoft.officeuifabricdemo.demos
import android.os.Bundle
import com.microsoft.officeuifabric.calendar.OnDateSelectedListener
import com.microsoft.officeuifabric.util.DateStringUtils
import com.microsoft.officeuifabricdemo.DemoActivity
import com.microsoft.officeuifabricdemo.R
import kotlinx.android.synthetic.main.activity_calendar_view.*
import org.threeten.bp.ZonedDateTime
class CalendarViewActivity : DemoActivity() {
override val contentLayoutId: Int
get() = R.layout.activity_calendar_view
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
calendar_view.onDateSelectedListener = object : OnDateSelectedListener {
override fun onDateSelected(date: ZonedDateTime) {
example_date_title.text = DateStringUtils.formatDateWithWeekDay(this@CalendarViewActivity, date)
}
}
}
}