vue-datetime icon indicating copy to clipboard operation
vue-datetime copied to clipboard

Dynamic format

Open DucatiGuy opened this issue 5 years ago • 0 comments

Versions

  • vue: 6.12.0
  • vue-datetime: 1.0.0-beta.14
  • luxon: 1.25.0

Description: Want to format date based on distance from current date

Is there an existing technique to dynamically format the date returned by the picker? e.g. one of the following Today 12:34 Tues 12.34 Tues 1 Oct 12:34

I have a function (formatDate) which returns a suitable format and have tried:

    <Datetime v-model="enterDateTime" 
              type="datetime" 
              title="Time to commence work" 
              :format="formatDate(enterStartDateTime)" 
              @input="formatDate(enterStartDateTime)" >
    </Datetime>

The above initially displays the date correctly but the format doesn't change on return from the picker.

DucatiGuy avatar Sep 16 '20 04:09 DucatiGuy