realm / realm-browser-osx

DEPRECATED - Realm Browser for Mac OS X has been replaced by realm-studio which is cross platform.
https://realm.io
501 stars 54 forks source link

How to enter nil as value for Date fields? #305

Open evgeny-sureev opened 7 years ago

evgeny-sureev commented 7 years ago

I am unable to enter nil value to optional Date field.

This is my model class:

class Oak: Object {
    dynamic var assignmentDate = Date()
    dynamic var readyDate: Date?
}

As you can see, field readyDate is defined as optional and allows nil values. Indeed it can have nil value if it created in code. But if I create such object in Realm Browser, readyDate gets assigned with current timestamp and I am unable to change it to nil.

nildate

At this screenshot, first and second rows are created in code, you can see nil date in second row.

Third row is created in Realm Browser, and you can see that 'readyDate' is equal to 'assignmentDate`.

How can I change Date value to be nil?

stel commented 7 years ago

Hey @evgeny-sureev! Sorry for a delay with this. Unfortunately there is no way to set nil for date values right now. It's just a UI limitation and we will try to fix it.

a0g83agbc84 commented 6 years ago

Any work on this?