date fields

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

date fields

Pierre Smits
Hi All,

How can I get in a date field the date of the first day of current month?
And in a second field the date of the last day of current month?

Regards,

Pierre
Reply | Threaded
Open this post in threaded view
|

Re: date fields

Pierre Smits
My apologies, I have to clarify.

I meant setting the default values of the date fields to either the first
day or the last day of the current month...

Regards,

Pierre

2010/8/26 Pierre Smits <[hidden email]>

> Hi All,
>
> How can I get in a date field the date of the first day of current month?
> And in a second field the date of the last day of current month?
>
> Regards,
>
> Pierre
>
Reply | Threaded
Open this post in threaded view
|

Re: date fields

Malin Nicolas
Use UtilDateTime.getMonthStart on getMonthEnd function with
nowTimestamps present in context

Nicolas

Pierre Smits a écrit :

> My apologies, I have to clarify.
>
> I meant setting the default values of the date fields to either the first
> day or the last day of the current month...
>
> Regards,
>
> Pierre
>
> 2010/8/26 Pierre Smits <[hidden email]>
>
>  
>> Hi All,
>>
>> How can I get in a date field the date of the first day of current month?
>> And in a second field the date of the last day of current month?
>>
>> Regards,
>>
>> Pierre
>>
>>    
>
>  

Reply | Threaded
Open this post in threaded view
|

Re: date fields

Adrian Crum-2
There is even an example of that in the Example component - using start of day I believe.

-Adrian

--- On Thu, 8/26/10, Nicolas Malin <[hidden email]> wrote:

> From: Nicolas Malin <[hidden email]>
> Subject: Re: date fields
> To: [hidden email]
> Date: Thursday, August 26, 2010, 4:51 AM
> Use UtilDateTime.getMonthStart on
> getMonthEnd function with
> nowTimestamps present in context
>
> Nicolas
>
> Pierre Smits a écrit :
> > My apologies, I have to clarify.
> >
> > I meant setting the default values of the date fields
> to either the first
> > day or the last day of the current month...
> >
> > Regards,
> >
> > Pierre
> >
> > 2010/8/26 Pierre Smits <[hidden email]>
> >
> >   
> >> Hi All,
> >>
> >> How can I get in a date field the date of the
> first day of current month?
> >> And in a second field the date of the last day of
> current month?
> >>
> >> Regards,
> >>
> >> Pierre
> >>
> >>     
> >
> >   
>
>



Reply | Threaded
Open this post in threaded view
|

Re: date fields

brajeshpatel
In reply to this post by Pierre Smits
hi Pierre,
GlAccountTrialBalance.groovy example using start of day at line 69.



On Thu, Aug 26, 2010 at 4:51 PM, Pierre Smits <[hidden email]>wrote:

> Hi All,
>
> How can I get in a date field the date of the first day of current month?
> And in a second field the date of the last day of current month?
>
> Regards,
>
> Pierre
>



--
Thanks
Brajesh Patel

HotWax Media
http://www.hotwaxmedia.com
Reply | Threaded
Open this post in threaded view
|

Re: date fields

joelfradkin@gmail.com
        <field name="FromDate" title="From Day (including unless time is set)" >
            <date-time default-value="${groovy: org.ofbiz.base.util.UtilDateTime.getMonthStart(org.ofbiz.base.util.UtilDateTime.nowTimestamp())}"/>
        </field>

There is a getMonthEnd  but not sure how to set timezone and locale.
        org.ofbiz.base.util.UtilDateTime.getMonthEnd(stamp, timeZone, locale)
Joel Fradkin