db.define_table('ActivityMapping',
Field('mapping_id'),
Field('resource_id',db.auth_user),
Field('org_id',db.Organization),
Field('solution_id',db.Solution),
Field('activity_id',db.Activity),
Field('activity_date','datetime', requires=IS_DATE()),
Field('effort')
)
On Tue, Aug 9, 2016 at 11:11 PM, Dave S <[email protected]> wrote:
>
>
> On Tuesday, August 9, 2016 at 9:09:08 AM UTC-7, madhu nomula wrote:
>>
>> Hi,
>>
>> I am trying to read date output from controller, but I am getting value in
>> View as decimal values:
>
>
> Which DB backend are you using?
>
> Can you show your define_table() code?
>
> /dps
>
>
>>
>>
>> controller Code:
>>
>> rowslistPeriod = db((
>> (db.AM.resource_id==db.auth_user.id)&
>>
>> (db.auth_user.id==auth.user.id)
>> ).select(db.auth_user.first_name,db.db.Solution.solution_code,db.Activity.activity_name,
>> db.AM.effort, db.AM.activity_date)
>> return dict(recordlistPeriod=rowslistPeriod
>>
>>
>> View Code:
>>
>> $(containerPreviousRecords).append('{{for x in recordlistPeriod:}}');
>>
>>
>> var ceffort= {{=x.AM.effort}};
>> var cDate= {{=x.AM.activity_date.strftime("%m/%d/%Y")}};
>> alert(cDate);
>>
>>
>> -----------------
>>
>> Here I am able to get number value (effort), when I am getting alert
>> getting x.AM.activity_date.strftime("%m/%d/%Y") values as
>> decimal(0.0036789......) instead of Date.
>>
>> Please help me to get date.
>>
>> Thanks,
>> MC
>
> --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.