Base solution for your next web application
Open Closed

DatePicker control avaiblable #3687


User avatar
0
bilalhaidar created

Hello, Does the project ship with a datepicker? I need to use a calendar control for the date of birth. I prefer not to add more npm packages unless I need to. Is there such a control in the application that I could use it?

Thanks


18 Answer(s)
  • User Avatar
    0
    mumfie created

    The latest version of AspNetZero includes a sample page with various date/time pickers to demonstrate usage.

  • User Avatar
    0
    bilalhaidar created

    Thanks.

    I have to upgrade then my project to make use of that?

  • User Avatar
    0
    bilalhaidar created

    Any idea where I can find this?

  • User Avatar
    0
    mumfie created

    <cite>bilalhaidar: </cite> Any idea where I can find this?

    I have the NET Core JQuery version and there is a page Demo UI Components[attachment=0:148tvurf]DemoUI.jpg[/attachment:148tvurf]HTH

  • User Avatar
    0
    bilalhaidar created

    Thanks. I believe that's only for the jQuery version. Those are not supported in Angular 2 unless we do something, which I don't know :)

    Maybe someone from the core team can assist here?

  • User Avatar
    0
    alirizaadiyahsi created

    We added these features for both jquery and angular projects. Check release notes for v4.3 : <a class="postlink" href="https://github.com/aspnetzero/aspnet-zero-core/releases/tag/v4.3.0">https://github.com/aspnetzero/aspnet-ze ... tag/v4.3.0</a>

  • User Avatar
    0
    alper created
    Support Team

    thanks mumfie ;)

  • User Avatar
    0
    bilalhaidar created

    Thanks. I was able to check them out.

    A question to the dev team, why not implement the Date control as an angular component rather than making use of jQuery?

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @bilalhaidar,

    We faced some problems converting jQuery datetimepicker to an angular component and we decided to use it like this. We might replace it if we can find a good angular datetimepicker which also works good with momentjs and moment timezone.

    Thanks.

  • User Avatar
    0
    bilalhaidar created

    Hi Ismail, We already discussed this on GitHub.

    If you direct me to how you are integrating this Date Calendar with moment and moment locale, points of integration.

    Thanks

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @bilalhaidar,

    We just set it's locale, see <a class="postlink" href="http://eonasdan.github.io/bootstrap-datetimepicker/#using-locales">http://eonasdan.github.io/bootstrap-dat ... ng-locales</a>. Other than that, we didn't do anything special I think.

    Thanks.

  • User Avatar
    0
    bilalhaidar created

    I noticed all DateTime properties in Angular 2 are of type moment.Moment. So they accept values as moment() correct?

    In my app, I use a Birth Date and some other Date field. I am already setting timezone to be Utc.

    Now, when I capture a Date value from the user using a Calendar (different from the one used by default). The Date selected in the Calendar I want it to be in UTC in order to be sent to server in UTC and stored in Utc. How would I do this?

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @bilalhaidar,

    If your control uses moment then it should be done automatically. If not, you can search on the web for converting a date to UTC using moment.

    Thanks.

  • User Avatar
    0
    bilalhaidar created

    Thanks Ismail.

    I am making use of primeng controls nowadays. They seem good.

    For now, I didn't need a Time with the date, so all selected dates in primeng are returned with Time reset. So it should be okay I believe.

    I will check more how to make the primeng Calendar moment-enabled (maybe it is I dunno, i will dig more).

  • User Avatar
    0
    bilalhaidar created

    FYI

    <a class="postlink" href="https://github.com/primefaces/primeng/pull/2141">https://github.com/primefaces/primeng/pull/2141</a>

  • User Avatar
    0
    ismcagdas created
    Support Team

    Thanks @bilalhaidar, good to know this :)

  • User Avatar
    0
    alexanderpilhar created

    FYI

    In case you are using Bootstrap 3 Datetimepicker ([http://eonasdan.github.io/bootstrap-datetimepicker/])) and want to work with a specific timezone, there is a timeZone-option which is not documented ([https://github.com/Eonasdan/bootstrap-datetimepicker/issues/2118])) but can be used to set the datetimepicker's timezone to UTC (or whatever you want to use).

    It's very useful in case you want to initialize a datetimepicker with a pre-set moment-object. Without this timeZone-option set there can occur really confusing results, like mismatching display- and date-values.

  • User Avatar
    0
    ismcagdas created
    Support Team

    Thanks @alexanderpilhar :)