Date Picker in tracker program

Dear community greetings,

Can we select a date picker just a year (yyyy) format instead of complete format (yyyy/MM/dd) as meta data or data in dhis2?

Regards
Jan Agha Stanikzai

Hi @janagha,

Although, there’s an updated version of the date picker in the Capture app which allows you to select the year (see image), however, even this updated version sticks to the same ‘date format’, and I understand from your question is that you request to change the date format itself? So an enrollment date would be (YYYY)? Would you like to describe the use case? Maybe we can create a feature request. :+1:
capture-app date picker

I know that it might be inconvenient if date and month are irrelevant for example in your use case, but you will always be able to filter by year when it comes to analytics & reports. Please share your opinion.

Thanks!

Thank you so much @Gassim for your response.

I would like to use date as vehicle model as 2022 instead of for example 1/1/2022. Is it possible or not?

Regards
Jan Agha Stanikzai

I’d suggest using an optionset for this one and value type text! (:

It won’t be a date picker but it’ll be a dropdown box if you are adding the data element to a form.

Dear @Gassim
I already have option set for this but i wanted to avoid adding values in option set in future.

Regards
Jan Agha Stanikzai

1 Like

Dear @janagha,

I tried to follow up on this and got a response from @jason. As you know there isn’t a ‘year’ type data element but if you are willing to create a custom form for this (which will require more work if you want it to also work on Android) then you’d use a positive integer as the data element (in android it’d be an integer).

You can create a date picker in the custom form using jQuery or some other framework to only get the year. Here are the links @jason sent as references/examples:

BTW, you can create a feature request if you want! :+1:

Thanks!

1 Like