aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPTableContent.m
diff options
context:
space:
mode:
authorrowanbeentje <rowan@beent.je>2013-03-06 00:29:45 +0000
committerrowanbeentje <rowan@beent.je>2013-03-06 00:29:45 +0000
commit9f85aaffb997a8baa41322021e4a76324a50b9a2 (patch)
treea9bf9dd3fe81af45a6877301a9df2f8a91393a13 /Source/SPTableContent.m
parentaa7d26a28f9609963478ffdebaf6b8ffcde32bcd (diff)
downloadsequelpro-9f85aaffb997a8baa41322021e4a76324a50b9a2.tar.gz
sequelpro-9f85aaffb997a8baa41322021e4a76324a50b9a2.tar.bz2
sequelpro-9f85aaffb997a8baa41322021e4a76324a50b9a2.zip
- If date-type fields are cleared, and allow NULLs, save the cell value as NULL; this implements Issue #1638
Diffstat (limited to 'Source/SPTableContent.m')
-rw-r--r--Source/SPTableContent.m4
1 files changed, 2 insertions, 2 deletions
diff --git a/Source/SPTableContent.m b/Source/SPTableContent.m
index 2ca31b70..85241ce2 100644
--- a/Source/SPTableContent.m
+++ b/Source/SPTableContent.m
@@ -2882,9 +2882,9 @@ static NSString *SPTableFilterSetDefaultOperator = @"SPTableFilterSetDefaultOper
NSString *fieldTypeGroup = [fieldDefinition objectForKey:@"typegrouping"];
// Use NULL when the user has entered the nullValue string defined in the preferences,
- // or when a numeric field is empty.
+ // or when a numeric or date field is empty.
if ([rowObject isNSNull]
- || (([fieldTypeGroup isEqualToString:@"float"] || [fieldTypeGroup isEqualToString:@"integer"])
+ || (([fieldTypeGroup isEqualToString:@"float"] || [fieldTypeGroup isEqualToString:@"integer"] || [fieldTypeGroup isEqualToString:@"date"])
&& [[rowObject description] isEqualToString:@""] && [[fieldDefinition objectForKey:@"null"] boolValue]))
{
fieldValue = @"NULL";