• WHO WE ARE
  • WHAT WE DO
    • Salesforce
      • Implementations
        • Sales Cloud
        • Service Cloud
        • CPQ
        • Field Service Lightning
        • Field Service for SMEs
      • Developments
        • Salesforce Customization
        • Custom Application Development
        • AppExchange Product Development
      • Migrations
        • Classic to Lightning Migration
        • Other Systems to Salesforce Migration
      • Integrations
    • Data Science
      • BI Solutions
      • AI/ML solutions
      • Agentic AI
  • HOW WE DO
    • Delivery Model
    • Our Works
  • REACH US
    • Contact Us
    • Careers
  • BLOG
    • WHO WE ARE
    • WHAT WE DO
      • Salesforce
        • Implementations
          • Sales Cloud
          • Service Cloud
          • CPQ
          • Field Service Lightning
          • Field Service for SMEs
        • Developments
          • Salesforce Customization
          • Custom Application Development
          • AppExchange Product Development
        • Migrations
          • Classic to Lightning Migration
          • Other Systems to Salesforce Migration
        • Integrations
      • Data Science
        • BI Solutions
        • AI/ML solutions
        • Agentic AI
    • HOW WE DO
      • Delivery Model
      • Our Works
    • REACH US
      • Contact Us
      • Careers
    • BLOG
  • [email protected]
  • (+91) 44-49521562
Merfantz - Salesforce Solutions for SMEs
Merfantz - Salesforce Solutions for SMEs
  • WHO WE ARE
  • WHAT WE DO
    • Salesforce
      • Implementations
        • Sales Cloud
        • Service Cloud
        • CPQ
        • Field Service Lightning
        • Field Service for SMEs
      • Developments
        • Salesforce Customization
        • Custom Application Development
        • AppExchange Product Development
      • Migrations
        • Classic to Lightning Migration
        • Other Systems to Salesforce Migration
      • Integrations
    • Data Science
      • BI Solutions
      • AI/ML solutions
      • Agentic AI
  • HOW WE DO
    • Delivery Model
    • Our Works
  • REACH US
    • Contact Us
    • Careers
  • BLOG

How can I Display Superscript on Date Format using VisualforcePage

  • July 27, 2017
  • Merfantz Editor
  • Salesforce Developments Tutorial
  • 0
I have faced this problem and struck how can I display superscript based on the date field. Finally, I got a good solution, I want to share with you.
The below example written on visualforce page code, whenever you changed date field in an object record, it will affect on the result. For example, if you changed the day as 21/07/2017 on date field, then result showing as ‘21st July 2017‘ on visualforce page. Result was showing superscript date format based on the days you entered on date field in an object record.

Note –

Object Api Name – Inspection_Sheet__c
Field Api Name – Date__c

Visualforce Code –

<apex:page standardController=’Inspection_Sheet__c’>

<!– 1st , 21st , 31st–>

<apex:outputpanel rendered=”{!IF(Day(Inspection_Sheet__c.Date__c ) = 1 || Day(Inspection_Sheet__c.Date__c ) = 21 ||
Day(Inspection_Sheet__c.Date__c ) = 31 , TRUE, FALSE) }” >
<apex:outputText value=”{0,date,dd}<sup>st</sup> {0,date,MMMM} {0,date,YYYY} ”  escape=”false” >
<apex:param value=”{!Inspection_Sheet__c.Date__c}” />
</apex:outputText>
</apex:outputpanel>

<!–2nd , 22nd –>

<apex:outputpanel rendered=”{!IF(Day(Inspection_Sheet__c.Date__c ) = 2 || Day(Inspection_Sheet__c.Date__c ) = 22  , TRUE, FALSE) }” >
<apex:outputText value=”{0,date,dd}<sup>nd</sup> {0,date,MMMM} {0,date,YYYY} ”  escape=”false” >
<apex:param value=”{!Inspection_Sheet__c.Date__c}” />
</apex:outputText>
</apex:outputpanel>

<!– 3rd , 23rd –>

<apex:outputpanel rendered=”{!IF(Day(Inspection_Sheet__c.Date__c ) = 3 || Day(Inspection_Sheet__c.Date__c ) = 23  , TRUE, FALSE) }” >
<apex:outputText value=”{0,date,dd}<sup>rd</sup> {0,date,MMMM} {0,date,YYYY} ”  escape=”false” >
<apex:param value=”{!Inspection_Sheet__c.Date__c}” />
</apex:outputText>
</apex:outputpanel>

<!– 4th , 5th to 20th , 24th to 30th –>

<apex:outputpanel rendered=”{!IF(Day(Inspection_Sheet__c.Date__c ) != 1 && Day(Inspection_Sheet__c.Date__c ) != 21 && Day(Inspection_Sheet__c.Date__c ) != 21 && Day(Inspection_Sheet__c.Date__c ) != 31 && Day(Inspection_Sheet__c.Date__c ) != 2 && Day(Inspection_Sheet__c.Date__c ) != 22 && Day(Inspection_Sheet__c.Date__c ) != 3 && Day(Inspection_Sheet__c.Date__c ) != 23, TRUE, FALSE) }” >
<apex:outputText value=”{0,date,dd}<sup>th</sup> {0,date,MMMM} {0,date,YYYY} ”  escape=”false” >
<apex:param value=”{!Inspection_Sheet__c.Date__c}” />
</apex:outputText>
</apex:outputpanel>
</apex:page>

We are the ISV Partners and Please reach us for custom development => www.merfantz.com

—————————— We Are Happy To Helping You!!!!!!!!!!!!!!!!!! ———————————–

 

Author Bio

Merfantz Editor
+ Recent Posts
  • August 4, 2023
    How to Setup CRM Analytics for Financial Services Cloud
  • August 2, 2023
    How to Get Started with Salesforce Hyperforce - Merfantz
  • July 28, 2023
    Health Cloud Mastery: Salesforce Trailhead for Effective Healthcare CRM
  • July 26, 2023
    How to integrate Data cloud and Marketing cloud In Salesforce
Tags: Field Service ManagementFieldax
  • Previous Include Bootstrap Using Visualfroce Page
  • Next Validation Rules on the VF page for Phone and Name in Salesforce

Leave a Reply

You must be logged in to post a comment.

Merfantz Technologies is a leading Salesforce consulting firm dedicated to helping small and medium enterprises transform their operations and achieve their goals through the use of the Salesforce platform. Contact us today to learn more about our services and how we can help your business thrive.

Discover More

Terms and Conditions
Privacy Policy
Cancellation & Refund Policy

Contact Info

  • No 96, 2nd Floor, Greeta Tech Park, VSI Industrial Estate, Perungudi, Chennai 600 096, Tamil Nadu, INDIA
  • (+91) 44-49521562
  • [email protected]
  • 9:30 IST - 18:30 IST

Latest Posts

Comprehensive Overview of Salesforce Agent-Force Platform
Comprehensive Overview of Salesforce Agent-Force Platform June 12, 2025
Salesforce GraphQL Revolutionizing Data Queries in CRM
Salesforce GraphQL: Revolutionizing Data Queries in CRM June 6, 2025
Unlocking the Power of Dynamic Forms in Salesforce Lightning App Builder
Unlocking the Power of Dynamic Forms in Salesforce Lightning App Builder May 29, 2025

Copyright @2023 Merfantz Technologies, All rights reserved