Skip to content
On this page

Timezones

To assign a timezone, pass the timezone: String prop with the desired timezone setting for either VDatePicker or VCalendar.

Reference this stack overflow question for guidance on obtaining a base list of available timezones. In addition to the timezones supported, UTC may be used for the Coordinated Universal Time setting.

By default, the timezone prop is undefined, which defaults to using the browser's local timezone.

Calendar Attributes

The timezone prop is used to set the beginning and ending time boundaries for each calendar day. As a result, a calendar attribute that displays for a user in one timezone may display differently in another timezone.

S
M
T
W
T
F
S
27
28
29
30
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
29
30
31
1
2
3
4
5
6
7
-11:00UTC+11:00
Timezone:utc
vue
<template>
  <TimezonePicker v-model="timezone" />
  <VCalendar :attributes="attrs" :timezone="timezone" />
</template>

<script setup>
import { ref, computed } from 'vue';

const timezone = ref('UTC');
const attrs = ref([
  {
    highlight: true,
    dates: { start: '2020-10-05T10:00:00Z', end: '2020-10-09T09:00:00Z' },
  },
  {
    dot: 'pink',
    dates: '2020-10-01T18:00:00Z',
  },
  {
    dot: 'indigo',
    dates: '2020-10-11T19:00:00Z',
  },
  {
    dot: 'indigo',
    dates: '2020-10-15T01:00:00Z',
  },
  {
    dot: 'red',
    dates: '2020-10-21T05:00:00Z',
  },
  {
    dot: 'green',
    dates: '2020-10-21T00:00:00Z',
  },
  {
    dot: 'blue',
    dates: '2020-10-29T03:00:00Z',
  },
]);
</script>

Date Picker

When using the timezone prop with VDatePicker, the displayed time will reflect the time associated with the date in the specified timezone.

Start:1/5/2020, 6:00:00 PM (date)
End:1/9/2020, 6:00:00 PM (date)
Timezone:
S
M
T
W
T
F
S
29
30
31
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
29
30
31
1
2
3
4
5
6
7
8
MonJan62020
:
FriJan102020
:
vue
<template>
  <TimezonePicker v-model="timezone" />
  <VDatePicker mode="dateTime" v-model.range="range" :timezone="timezone" />
</template>

<script>
import { ref, computed } from 'vue';

const timezone = ref('UTC');
const range = {
  start: Date.UTC(2020, 0, 6),
  end: Date.UTC(2020, 0, 10),
};
</script>

Time Rules

Assigned rules will respect the assigned timezone, or the local browser's timezone otherwise.

Start:1/6/2020, 12:00:00 AM (date)
End:1/10/2020, 12:00:00 AM (date)
S
M
T
W
T
F
S
29
30
31
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
29
30
31
1
2
3
4
5
6
7
8
vue
<template>
  <VDatePicker v-model.range="range" :rules="rules" timezone="UTC" />
</template>

<script setup>
import { ref } from 'vue';

const range = ref({
  start: new Date(2020, 0, 6),
  end: new Date(2020, 0, 10),
});
const rules = ref({
  hours: 12,
  minutes: 0,
  seconds: 0,
});
</script>

Released under the MIT License.