question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Hi,

In my app I have a null date to begin with and then the user can choose a date from the picker. When I use the below code I am getting the current datetime but I want it to be blank. How can I achieve this?

date={taskTime ? moment.tz(taskTime, businessTimeZone).format("DD-MMM-YYYY, h:mm A") : null}
mode="datetime"
format="DD-MMM-YYYY, h:mm A"

If I use this code I get Invalid Date being displayed which again is not what I want. date={moment.tz(taskTime, businessTimeZone).format("DD-MMM-YYYY, h:mm A")}

Issue Analytics

  • State:open
  • Created 6 years ago
  • Reactions:13
  • Comments:8

github_iconTop GitHub Comments

9reactions
tong233commented, Jun 5, 2018

add placeholder=" "

5reactions
ceefourcommented, Dec 4, 2017

I also need this too.

I want the user to enter their birthdate, but by default it should be blank. Also it should be possible for the user to clear the input.

Read more comments on GitHub >

github_iconTop Results From Across the Web

c# - DateTime "null" value
Given the nature of a date/time data type it cannot contain a null value, i.e. it needs ...
Read more >
How to set DateTime to null in C#
DateTime is a Value Type like int, double etc. so there is no way to assigned a null value. if(date == null) //WRONG....
Read more >
2 ways to replace Null date with blank in Tableau
Learn 2 different ways to replace a Null date with a blank in Tableau. Use either a formula or set the alias.
Read more >
How to handle nulldate() or no date values from input ...
Hi There. please suggest how to store null values (datetime column at database) instead of default null value "1900-01-01 00.00" into ...
Read more >
Null dates
The concept of a null date in SAP applications is represented by a value called INITIAL that is a property of every SAP...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found