Eureka - DateRow load date without changing its current value
up vote
1
down vote
favorite
This is my eureka daterow code. Where row value is set only after making any changes in the datepickerview. I need to load the date to row on cell selection on the daterow. Thanks in advance.
form +++ DateRow(name) {
$0.title = label
}.onChange({ (row) in
if let value = row.value {
let dateFormatter = DateFormatter()
dateFormatter.dateFormat = "yyyy-MM-dd"
let date = dateFormatter.string(from: value)
let item = CustomField(coulmnId: fieldId, columnValue: date)
self.addToCustom(set: item)
}
})
swift eureka-forms
add a comment |
up vote
1
down vote
favorite
This is my eureka daterow code. Where row value is set only after making any changes in the datepickerview. I need to load the date to row on cell selection on the daterow. Thanks in advance.
form +++ DateRow(name) {
$0.title = label
}.onChange({ (row) in
if let value = row.value {
let dateFormatter = DateFormatter()
dateFormatter.dateFormat = "yyyy-MM-dd"
let date = dateFormatter.string(from: value)
let item = CustomField(coulmnId: fieldId, columnValue: date)
self.addToCustom(set: item)
}
})
swift eureka-forms
add a comment |
up vote
1
down vote
favorite
up vote
1
down vote
favorite
This is my eureka daterow code. Where row value is set only after making any changes in the datepickerview. I need to load the date to row on cell selection on the daterow. Thanks in advance.
form +++ DateRow(name) {
$0.title = label
}.onChange({ (row) in
if let value = row.value {
let dateFormatter = DateFormatter()
dateFormatter.dateFormat = "yyyy-MM-dd"
let date = dateFormatter.string(from: value)
let item = CustomField(coulmnId: fieldId, columnValue: date)
self.addToCustom(set: item)
}
})
swift eureka-forms
This is my eureka daterow code. Where row value is set only after making any changes in the datepickerview. I need to load the date to row on cell selection on the daterow. Thanks in advance.
form +++ DateRow(name) {
$0.title = label
}.onChange({ (row) in
if let value = row.value {
let dateFormatter = DateFormatter()
dateFormatter.dateFormat = "yyyy-MM-dd"
let date = dateFormatter.string(from: value)
let item = CustomField(coulmnId: fieldId, columnValue: date)
self.addToCustom(set: item)
}
})
swift eureka-forms
swift eureka-forms
edited 13 hours ago
vadian
138k13144165
138k13144165
asked 13 hours ago
Vaisakh Kp
177
177
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
up vote
1
down vote
accepted
You just need to set the row
value
so that picker
can use that at startup,
form +++ DateRow("name") {
$0.title = "label"
}.onCellSelection({ (cell, row) in
if row.value == nil {
row.value = Date()// Set default value.
}
}).onChange({ (row) in
...
Since it is a non mandatory field, i cannot cll it on initialisation. How can i set value on eventonCellSelection()
– Vaisakh Kp
10 hours ago
1
@VaisakhKp Updated the answer.
– Kamran
10 hours ago
Does the DateRow have any events likeonPresent()
?
– Vaisakh Kp
10 hours ago
No, there is noonPresent
callback. What do you want to achieve btw? You can check all callbacks here
– Kamran
10 hours ago
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
accepted
You just need to set the row
value
so that picker
can use that at startup,
form +++ DateRow("name") {
$0.title = "label"
}.onCellSelection({ (cell, row) in
if row.value == nil {
row.value = Date()// Set default value.
}
}).onChange({ (row) in
...
Since it is a non mandatory field, i cannot cll it on initialisation. How can i set value on eventonCellSelection()
– Vaisakh Kp
10 hours ago
1
@VaisakhKp Updated the answer.
– Kamran
10 hours ago
Does the DateRow have any events likeonPresent()
?
– Vaisakh Kp
10 hours ago
No, there is noonPresent
callback. What do you want to achieve btw? You can check all callbacks here
– Kamran
10 hours ago
add a comment |
up vote
1
down vote
accepted
You just need to set the row
value
so that picker
can use that at startup,
form +++ DateRow("name") {
$0.title = "label"
}.onCellSelection({ (cell, row) in
if row.value == nil {
row.value = Date()// Set default value.
}
}).onChange({ (row) in
...
Since it is a non mandatory field, i cannot cll it on initialisation. How can i set value on eventonCellSelection()
– Vaisakh Kp
10 hours ago
1
@VaisakhKp Updated the answer.
– Kamran
10 hours ago
Does the DateRow have any events likeonPresent()
?
– Vaisakh Kp
10 hours ago
No, there is noonPresent
callback. What do you want to achieve btw? You can check all callbacks here
– Kamran
10 hours ago
add a comment |
up vote
1
down vote
accepted
up vote
1
down vote
accepted
You just need to set the row
value
so that picker
can use that at startup,
form +++ DateRow("name") {
$0.title = "label"
}.onCellSelection({ (cell, row) in
if row.value == nil {
row.value = Date()// Set default value.
}
}).onChange({ (row) in
...
You just need to set the row
value
so that picker
can use that at startup,
form +++ DateRow("name") {
$0.title = "label"
}.onCellSelection({ (cell, row) in
if row.value == nil {
row.value = Date()// Set default value.
}
}).onChange({ (row) in
...
edited 10 hours ago
answered 11 hours ago
Kamran
4,86711027
4,86711027
Since it is a non mandatory field, i cannot cll it on initialisation. How can i set value on eventonCellSelection()
– Vaisakh Kp
10 hours ago
1
@VaisakhKp Updated the answer.
– Kamran
10 hours ago
Does the DateRow have any events likeonPresent()
?
– Vaisakh Kp
10 hours ago
No, there is noonPresent
callback. What do you want to achieve btw? You can check all callbacks here
– Kamran
10 hours ago
add a comment |
Since it is a non mandatory field, i cannot cll it on initialisation. How can i set value on eventonCellSelection()
– Vaisakh Kp
10 hours ago
1
@VaisakhKp Updated the answer.
– Kamran
10 hours ago
Does the DateRow have any events likeonPresent()
?
– Vaisakh Kp
10 hours ago
No, there is noonPresent
callback. What do you want to achieve btw? You can check all callbacks here
– Kamran
10 hours ago
Since it is a non mandatory field, i cannot cll it on initialisation. How can i set value on event
onCellSelection()
– Vaisakh Kp
10 hours ago
Since it is a non mandatory field, i cannot cll it on initialisation. How can i set value on event
onCellSelection()
– Vaisakh Kp
10 hours ago
1
1
@VaisakhKp Updated the answer.
– Kamran
10 hours ago
@VaisakhKp Updated the answer.
– Kamran
10 hours ago
Does the DateRow have any events like
onPresent()
?– Vaisakh Kp
10 hours ago
Does the DateRow have any events like
onPresent()
?– Vaisakh Kp
10 hours ago
No, there is no
onPresent
callback. What do you want to achieve btw? You can check all callbacks here– Kamran
10 hours ago
No, there is no
onPresent
callback. What do you want to achieve btw? You can check all callbacks here– Kamran
10 hours ago
add a comment |
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53371964%2feureka-daterow-load-date-without-changing-its-current-value%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown