Hello @All,
I have been working on a Document Management System project lately for a School. The system aims to store documents of students for a school established back in 1955.
During the development we had to generate the Transfer Certificates (TC) of the students, hence helping the overhead expenses of time, printing and manual generation of TC. During the development of the TC generation module we were posed with a requirement of printing the Date of Birth (DoB) of Students in Words and Figures.
While Figures can be done easily using the <cms:date> tag, the DoB in Words (English) was a challenge. I did search the internet for Cardinal and Ordinal Date formats but did not find something that could be put to use as per the requirement. This led to the development of a small module "Numeric Date to Words (English)". We am sharing the same here. It entirely uses couch tags to convert the numeric data to Words. It is a small code, nothing exquisite but we hope it will benefit the community.
There are four steps in total, required to implement this, viz.:
1. Copy the attached file "date-in-words.html" to the snippets folder.
2. Renaming the editable (in example, dateofbirth)
3. Embedding the "date-in-words.html" where you need to call it, using:
4. Displaying the output using:
I hope that my fellow Couch Developers find this useful.
Regards,
GenXCoders
I have been working on a Document Management System project lately for a School. The system aims to store documents of students for a school established back in 1955.
During the development we had to generate the Transfer Certificates (TC) of the students, hence helping the overhead expenses of time, printing and manual generation of TC. During the development of the TC generation module we were posed with a requirement of printing the Date of Birth (DoB) of Students in Words and Figures.
While Figures can be done easily using the <cms:date> tag, the DoB in Words (English) was a challenge. I did search the internet for Cardinal and Ordinal Date formats but did not find something that could be put to use as per the requirement. This led to the development of a small module "Numeric Date to Words (English)". We am sharing the same here. It entirely uses couch tags to convert the numeric data to Words. It is a small code, nothing exquisite but we hope it will benefit the community.
There are four steps in total, required to implement this, viz.:
1. Copy the attached file "date-in-words.html" to the snippets folder.
2. Renaming the editable (in example, dateofbirth)
- Code: Select all
<cms:set convert_date = "<cms:date dateofbirth format='d-m-Y' />" scope="global" />
3. Embedding the "date-in-words.html" where you need to call it, using:
- Code: Select all
<cms:embed 'date-in-words.html' />
4. Displaying the output using:
- Code: Select all
<cms:show date_in_words />
I hope that my fellow Couch Developers find this useful.
Regards,
GenXCoders