Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(date): add new composable #16691

Merged
merged 15 commits into from
Apr 20, 2023
Merged

feat(date): add new composable #16691

merged 15 commits into from
Apr 20, 2023

Conversation

johnleider
Copy link
Member

@johnleider johnleider commented Feb 16, 2023

Motivation and Context

New composable to share common date functionality

Markup:

<template>
  <v-app>
    <div class="ma-4 pa-4">
      <div v-for="(week, i) in weeks" :key="i" class="d-flex border-t border-s">
        <v-sheet
          v-for="(day, j) in week"
          :key="j"
          height="128"
          :color="!day ? 'grey-lighten-4' : 'surface'"
          :class="[
            'border-e text-center',
            i === 4 ? 'border-b' : '',
          ]"
          style="flex: 1 1 100%"
        >
          {{ day?.getDate() }}
        </v-sheet>
      </div>
    </div>
  </v-app>
</template>

<script setup>
  import { computed } from 'vue'
  import { useDate } from '../src/composables/date'

  const date = useDate({
    displayDate: new Date(),
  })

  const weeks = computed(() => {
    return date.weeksInMonth.value
  })
</script>

@johnleider johnleider force-pushed the feat/v3-date-picker-alt branch from aecb7a9 to af6a215 Compare February 17, 2023 22:25
@johnleider johnleider changed the base branch from feat/v3-date-picker to dev February 17, 2023 22:26
@johnleider johnleider force-pushed the feat/v3-date-picker-alt branch from 57042b5 to 1baaf33 Compare February 22, 2023 15:08
@johnleider johnleider changed the title refactor(VPicker): implement date calculation locally feat(date): add new composable Mar 1, 2023
@johnleider johnleider self-assigned this Mar 2, 2023
@nekosaur
Copy link
Member

nekosaur commented Mar 5, 2023

yep something like this is what I had planned. the built in adapter is not very locale friendly but that can be a later problem

@lorand-horvath
Copy link
Contributor

Good idea!

@johnleider johnleider force-pushed the feat/v3-date-picker-alt branch from 7858fbe to ce15a2a Compare March 27, 2023 16:29
@johnleider johnleider marked this pull request as ready for review April 3, 2023 20:50
@johnleider johnleider added this to the v3.x.x milestone Apr 3, 2023
@johnleider johnleider requested review from KaelWD and nekosaur and removed request for KaelWD April 3, 2023 23:46
@johnleider johnleider force-pushed the feat/v3-date-picker-alt branch from 9abc5b1 to db55023 Compare April 10, 2023 20:56
@johnleider johnleider modified the milestones: v3.x.x, v3.2.0 (Orion) Apr 11, 2023
@johnleider johnleider force-pushed the feat/v3-date-picker-alt branch from 542a24d to 9d2697f Compare April 17, 2023 22:27
@johnleider johnleider requested a review from a team April 17, 2023 22:32
@johnleider johnleider force-pushed the feat/v3-date-picker-alt branch from efe5f05 to 9d2697f Compare April 19, 2023 03:10
@johnleider johnleider merged commit 919dab2 into dev Apr 20, 2023
@johnleider johnleider deleted the feat/v3-date-picker-alt branch April 20, 2023 14:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants