For Zoho Services only:


I'm actually part of a bigger team at Ascent Business Solutions where we have support technicians and project consultants. Support is for smaller technical fixes but this can include developments, reports or integrations; depending on the size of the task. Projects are for more time-consuming developments such as revamps of the Zoho Suite of apps or on-site training. The advantage of a team is that if I am out-of-office for a day or so, there is always someone at Ascent Business Solutions who can deal with any queries/issues you may have.

Our support rates can be found and purchased at http://ascentbusiness.co.uk/zoho-support-2. A support bundle doesn't have an expiry date. So whether we can do what you want within the bundle and a year later need further support, if there are minutes left on the bundle then there is no additional charge.

Our project rates for bigger developments can be found at http://ascentbusiness.co.uk/crm-solutions/zoho-crm-packages-prices and will involve a dedicated project consultant along with developers who will hold your hand through the development process.

If you want help building a solution for one of the Zoho Apps in the Zoho Suite, contact us on 0121 293 8140 (UK) or by email at info@ascentbusiness.co.uk. You can also visit our website at http://ascentbusiness.co.uk.

I regularly build and specialize in 2-way API integrations for Xero, Shopify and eBay.

Zoho Deluge - Get Full Day Name

What?
This is a very quick note with the code to retrieve the full day name from a date (eg. "Monday").

Why?
If I use the toString() function to get the day, it only returns the first 3 letters of the day (eg. "Mon").
copyraw
My_Date = today;
Day_Name = My_Date.toString("E");  // returns "Mon"
  1.  My_Date = today
  2.  Day_Name = My_Date.toString("E");  // returns "Mon" 
How?
Well a few methods.

Method #0: Update 2020
Tested in CRM and Creator and this is working:
copyraw
My_Date = today;
Day_Name = My_Date.toString("EEEE");  // returns "Monday"
  1.  My_Date = today
  2.  Day_Name = My_Date.toString("EEEE");  // returns "Monday" 

Method #1:
We're going to populate two arrays / lists; retrieve the index value; and use this in the second array as follows:
copyraw
// lists
	Day_Names = List:String({"Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"});
	Day_Abbreviations = List:String({"Mon","Tue","Wed","Thu","Fri","Sat","Sun"});

	// get date field day abbreviation
	Day_Abbreviation = My_Date.toString("E");   

	// find in array and return same index from first array
	Day_Name = Day_Names.get(Day_Abbreviations.indexOf(Day_Abbreviation));
  1.  // lists 
  2.      Day_Names = List:String({"Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"})
  3.      Day_Abbreviations = List:String({"Mon","Tue","Wed","Thu","Fri","Sat","Sun"})
  4.   
  5.      // get date field day abbreviation 
  6.      Day_Abbreviation = My_Date.toString("E")
  7.   
  8.      // find in array and return same index from first array 
  9.      Day_Name = Day_Names.get(Day_Abbreviations.indexOf(Day_Abbreviation))
Reducing the code lines but using the same technique as above:
copyraw
Day_Names = List:String({"Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"});
	Day_Abbreviations = List:String({"Mon","Tue","Wed","Thu","Fri","Sat","Sun"});
	Day_Name = Day_Names.get(Day_Abbreviations.indexOf(My_Date.toString("E")));
  1.  Day_Names = List:String({"Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"})
  2.      Day_Abbreviations = List:String({"Mon","Tue","Wed","Thu","Fri","Sat","Sun"})
  3.      Day_Name = Day_Names.get(Day_Abbreviations.indexOf(My_Date.toString("E")))

Method #2:
Using a map, we can reduce this to two lines of code:
copyraw
Day_Map = {"Mon":"Monday","Tue":"Tuesday","Wed":"Wednesday","Thu":"Thursday","Fri":"Friday","Sat":"Saturday","Sun":"Sunday"};
	Day_Name = Day_Map.get(My_Date.toString("E"));
  1.  Day_Map = {"Mon":"Monday","Tue":"Tuesday","Wed":"Wednesday","Thu":"Thursday","Fri":"Friday","Sat":"Saturday","Sun":"Sunday"}
  2.      Day_Name = Day_Map.get(My_Date.toString("E"))

Method #3:
Using a list, the inevitable single line:
copyraw
Day_Name = ",Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday".toList(",").get(My_Date.toDate().getDayOfWeek());
  1.  Day_Name = ",Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday".toList(",").get(My_Date.toDate().getDayOfWeek())
Category: Zoho :: Article: 653

Related Articles

Joes Revolver Map

Accreditation

Badge - Certified Zoho Creator Associate
Badge - Certified Zoho Creator Associate

Donate & Support

If you like my content, and would like to support this sharing site, feel free to donate using a method below:

Paypal:
Donate to Joel Lipman via PayPal

Bitcoin:
Donate to Joel Lipman with Bitcoin - Valid till 8 May 2022 3QnhmaBX7LQSRsC9hh6Je9rGQKEGNQNfPb
© 2021 Joel Lipman .com. All Rights Reserved.