Entries for year: 2010

Calculate Next Billing Date

I had a need to figure out the next billing date after today, based on a known start date and billing interval. Here's the function I came up with to make it happen.

<cffunction name="getNextBilling" access="public" output="false" returntype="date" >
    <cfargument 
        name="StartDate" 
        type="date" 
        required="true" 
        hint="The date the billing started" 
    />
    <cfargument 
        name="BillingInterval" 
        type="numeric" 
        required="true" 
        hint="The number of units for the billing. For example, 
            if something is billed every 90 days, this value will be 90" 
    />
    <cfargument 
        name="IntervalUnit" 
        type="string" 
        default="d" 
        required="false" 
        hint="The date part for the billing interval. This is the 
            CF datepart, such as 'd', 'm', 'yyyy', etc. The default is 'd'." 
    />

    <cfset var TimeFromStart = DateDiff(Arguments.IntervalUnit, StartDate, Now()) />

    <cfreturn DateAdd(Arguments.IntervalUnit, TimeFromStart + Arguments.BillingInterval - (TimeFromStart MOD Arguments.BillingInterval), Arguments.Startdate) />

</cffunction>

Let me know if you spot a problem with the solution, or have suggestions for improvement.

Show in Finder in Eclipse

It's horribly annoying trying to find a file on your file system when it's buried folders deep in your project, on who knows which hard drive. In an effort to make this easier I scoured the interwebs for you, and found a solution.

Read more...

ColdFusion 9: AJAX Controls and Techniques

AJAX: The panacea for all of your Web 2.0 problems...

Well not really... AJAX can sometimes cause more problems than it solves. Especially if you don't have a good handle on exactly what it is you're doing with it. The AJAX frameworks available today are large and daunting, and can be extremely intimidating.

ColdFusion, sticking with its "make hard thing easier" mantra, has done a lot of work to make it easy to incorporate AJAX functionality into your sites. Unfortunately, this requires a little training as well :-)

To get you started, I'm happy to announce the release of ColdFusion 9: AJAX Controls and Techniques.

This course will take you through all of the basics of using AJAX controls and techniques in ColdFusion 9 (is that a descriptive title or what!?)

After watching this course, you'll come away with the following nuggets of wisdom:

  • Manipulating and securing container contents
  • Debugging AJAX behaviors
  • Building UI elements such as accordions and border layouts
  • Using rich prompts with cfmessagebox
  • Understanding advanced cffileupload
  • Sorting and grouping data in grids
  • Binding data to form fields
  • Creating a map with markers

I hope you enjoy the new title, and let me know if you have any questions. I'll be watching the comments :-).

ColdFusion Builder Essential Training Launched

ColdFusion Builder has finally been launched!

It seems like it's been forever since the original Bolt beta started, but CFBuilder is finally hitting the streets. I've been using Bolt and CFBuilder as my one and only ColdFusion IDE since the early Bolt betas, and I can tell you that I have no intention of going back to one of those "others".

After a few frustrations with early betas I tried going back to CFEcilpse (and even Dreamweaver at one point), but just couldn't bring myself to go without all of the fantastic component auto-completion and server integration.

There's lots of blog coverage of the release of ColdFusion Builder, including talk of new features, so I won't talk at length about any specific features. I do, however, want to point you to my new ColdFusion Builder Essential Training title at lynda.com.

ColdFusion Builder Essential Training is designed to teach both new and experienced ColdFusion developers how to configure servers and services, generate data-aware components, and create custom extensions. It doesn't cover every single little in and out of ColdFusion Builder, but it will go a long way to helping you get up to speed with the new product. Topics include:

  • Installing ColdFusion Builder
  • Customizing the ColdFusion Builder workspace
  • Managing assets within a project
  • Setting up ColdFusion servers
  • Coding with Code Assist, code coloring and syntax checking
  • Using snippets
  • Working with components and variable mappings
  • Creating ColdFusion Builder extensions

I hope you enjoy the new title, and let me know if you have any questions. I'll be watching the comments :-).

Powered by Mango Blog.