Tcomb-form-native: No style applied to Date

Created on 26 Sep 2017  路  2Comments  路  Source: gcanti/tcomb-form-native

I am using tcomb in react native app

Expected behaviour

Date supposed to have style applied to it

Actual behaviour

There is no style shown.. I also tried to override stylesheet , but it seems that styles do not apply

date

Code snippet

const Form = t.form.Form;

Form.stylesheet.datepicker.normal.marginBottom = 20; // Not working , no changes applied
Form.stylesheet.datepicker.normal.borderColor = '#000';  // Not working as well

const formRegistration = t.struct({
    // other fields
    birthDate: t.maybe(t.Date)
});
const options = {
    fields: {
        birthDate : {
              label: 'Birth Date',
              mode: 'date',
              config: {
                   format: (date) => myDateFormat('LL', date)
             }
         }
     }
 };

Most helpful comment

@jlsuarezs Yes I found the solution... Looking at this: https://github.com/gcanti/tcomb-form-native/blob/master/lib/stylesheets/bootstrap.js
The style for the date is in dateValue at line 196

so this is what I did to style it according to what I need

const Form = t.form.Form;

Form.stylesheet.dateValue.normal.borderColor = '#d0d2d3';
Form.stylesheet.dateValue.normal.backgroundColor = '#f0f1f1';
Form.stylesheet.dateValue.normal.borderWidth = 1;

you follow the same way to style other components in tcomb (e.g: labels: Form.stylesheet.controlLabel.normal.fontSize = 14;)

All 2 comments

I have the same issue, any help?

Thanks in advance.

@jlsuarezs Yes I found the solution... Looking at this: https://github.com/gcanti/tcomb-form-native/blob/master/lib/stylesheets/bootstrap.js
The style for the date is in dateValue at line 196

so this is what I did to style it according to what I need

const Form = t.form.Form;

Form.stylesheet.dateValue.normal.borderColor = '#d0d2d3';
Form.stylesheet.dateValue.normal.backgroundColor = '#f0f1f1';
Form.stylesheet.dateValue.normal.borderWidth = 1;

you follow the same way to style other components in tcomb (e.g: labels: Form.stylesheet.controlLabel.normal.fontSize = 14;)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

scarlac picture scarlac  路  4Comments

muthuraman007 picture muthuraman007  路  4Comments

sibelius picture sibelius  路  4Comments

dvlprmartins picture dvlprmartins  路  4Comments

ilyadoroshin picture ilyadoroshin  路  4Comments