Giter Club home page Giter Club logo

Comments (5)

CosticaPuntaru avatar CosticaPuntaru commented on June 27, 2024

it returns a date, angular or javascript formats it to the iso... you can simply do something like
<div date-range start="model.startTime" end="model.endTime"></div>
and then show the dates like:
flight between {{model.startTime.toDateString() }} and {{model.startTime.toDateString() }}

from angular-datepicker.

geoidesic avatar geoidesic commented on June 27, 2024

Thanks.. that really helped! What I'm still confused about is how to change the way the date displays as it get's placed by the datepicker in the datepicker field. For an input field using toDateString on the value attribute doesn't seem to work reliably.

<input type="text" template="datepicker.html" date-time ng-model="start.value" required="true" view="hours" partial="true" value="{{start.value.toDateString()}}">

That seems to work if you click a date, but once you click a time then it goes back to YYYY-MM-DD H:M format.

from angular-datepicker.

g00fy- avatar g00fy- commented on June 27, 2024

@geoidesic
use format="angular-format-string"

from angular-datepicker.

geoidesic avatar geoidesic commented on June 27, 2024

The trouble with an angular format string is that it's not automatically localised, whereas toDateString() is.

from angular-datepicker.

g00fy- avatar g00fy- commented on June 27, 2024

@geoidesic
It is, just need to use angular-i18n and include the script with the language you want. See https://github.com/angular/bower-angular-i18n and https://docs.angularjs.org/guide/i18n

from angular-datepicker.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.