Ion-datetime - show weekday


#1

I would like to show the user also the weekday when he selects a date. It should have the following format:
Tue, 06 06 2017
I tried the following:
<ion-datetime pickerFormat="DDD, D MM YYYY"></ion-datetime>
but it only shows this format: 06 06 2017, without the weekday.

How can I display the weekday in ion-datetime picker?


#2

Aside from the <ion-datetime> element missing its closing >, what you have works for me in a scratch project:

Cordova CLI: 7.0.1
Ionic Framework Version: 3.1.1
Ionic CLI Version: 2.2.3
Ionic App Lib Version: 2.2.1
Ionic App Scripts Version: 1.3.7
ios-deploy version: Not installed
ios-sim version: Not installed
OS: Linux 4.9
Node Version: v6.10.0
Xcode version: Not installed


#3

That was a typo, thanks for the hint.

Does it show the day of the week (Monday, Tuesday, etc)?


#4

Yes, it did. Discourse is silly.


#5

I don’t think that you understood my problem…I just tried it on a blank project and it does not work as expected. This is what I get:

This is what I am expecting:


#6

Someone? I also need this


#7

I just saw that on the native datepicker the day is shown…

d932bb88-19b5-4ce2-bdbe-67298719699d

Is ionic going to add this any time soon?


#8

I found this in the code:

// does not support selecting by day name
// automaticallly remove any day name formats
template = template.replace('DDDD', '{~}').replace('DDD', '{~}');

Why?


#9

I also need this, I hope it will be implemented soon.


#10

I am now using angular material2 datepicker because of this.


#11

I’m not sure, but it seems you can now use a pipe out of anything with ionic 3 quite fully updated. The other day I converted a unix date directly in the template view, with zero-hassle:

{{ currentSubValues?.current_period_start * 1000 | date:'dd/MM/yyyy HH:mm Z' }}

Otherwise, @Daskus to get a cool calendar date picker I used this one from Github:
https://github.com/HsuanXyz/ion2-calendar

Which requires moment.js too.