getTimeParting 6.2, how can I get month in numeric? | Adobe Higher Education
Skip to main content
Level 2
October 9, 2023
解決済み

getTimeParting 6.2, how can I get month in numeric?

  • October 9, 2023
  • 1 の返信
  • 813 ビュー

Previously we were getting 9/27/2023|4:02 AM|Wednesday this format, Now with the 6.2 version the output is year=2023 | month=September | date=27 | day=Wednesday | time=11:35 PM.

I tired different things but unable to get month in numeric format.

any tips?

 

Also explain  a = /([a-zA-Z]+).*?([a-zA-Z]+).*?([0-9]+).*?([0-9]+)(.*?)([0-9])(.*)/.exec(a);

 

このトピックへの返信は締め切られました。
ベストアンサー yuhuisg

Looks like the plug-in did away with your old format since its version 4.0 update in August 2016. To get back your desired value, you'll need to use some custom code to convert the plug-in's returned values to what you want.

Something like this:

 

// use this inside your AA extension's custom code's doPlugins section const monthNames = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']; const timePartingString = s.getTimeParting(); const timePartingParts = timePartingString.split('|').map((value) => value.split('=')[1].trim()); const [timePartingYear, timePartingMonth, timePartingDay, timePartingDayOfWeek, timePartingTime] = timePartingParts; s.eVarXX = `${monthNames.indexOf(timePartingMonth) + 1}/${timePartingDay}/${timePartingYear}|${timePartingTime}|${timePartingDayOfWeek}`;

 

 

Please test this code properly before publishing it to live!

1 の返信

yuhuisg
Community Advisor
yuhuisgCommunity Advisor回答
Community Advisor
October 9, 2023

Looks like the plug-in did away with your old format since its version 4.0 update in August 2016. To get back your desired value, you'll need to use some custom code to convert the plug-in's returned values to what you want.

Something like this:

 

// use this inside your AA extension's custom code's doPlugins section const monthNames = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']; const timePartingString = s.getTimeParting(); const timePartingParts = timePartingString.split('|').map((value) => value.split('=')[1].trim()); const [timePartingYear, timePartingMonth, timePartingDay, timePartingDayOfWeek, timePartingTime] = timePartingParts; s.eVarXX = `${monthNames.indexOf(timePartingMonth) + 1}/${timePartingDay}/${timePartingYear}|${timePartingTime}|${timePartingDayOfWeek}`;

 

 

Please test this code properly before publishing it to live!

Swapna_0506作成者
Level 2
October 10, 2023

Thank you, It worked with few changes.