candian date format Follow

0
Avatar
james nugent

hi look at the other post regarding this and could not figure this out    the version I am running is bartender 2016 R3   

could you provide a step by step method for this please

6 comments

0
Avatar
Pete Thane
Comment actions Permalink

I am guessing that the header included a typo and you mean Canadian Date Format.

In your text field, set the Source to Clock and then on Data Type tab adjust the Locale to English (Canada) and then various different layouts will be selectable from the list.

If none of these suit your requirements , choose the Custom option and amend the "Pattern" box to , such as YYYY-MMM-dd to print 2020-Feb-19 etc.

 

0
Avatar
Pete Thane
Comment actions Permalink

Sorry meant to have added this image to the above

0
Avatar
james nugent
Comment actions Permalink

Sorry I am looking the Canadian bi lingual date format. January. Is JA. February is FE. March is MR. Etc

0
Avatar
Pete Thane
Comment actions Permalink

Okay, not come across that before and so not sure what the other months should be and so you may need to adjust a couple of bits I am guessing

  1. Add a date field onto you label (or off the side if you dont need to print it) and make it use one the normal date formats
  2. On the Data Source tab of this field click on the Change Data Source Name button and give this field a name. I used PackDate for my sample 
  3. For your Canadian date field add a text field onto the label and give it a Visual Basic Script source 
  4. I would suggest you make the type Event Controlled Script rather and then click the Edit with Script Editor button (see screenshot below)
  5. In the central edit box (with OnAutoselectedEvent still selected in the column on the left) change the code to Value = Now()
  6. Now scroll down in the left hand column until you come to OnIdenticalCopies, select this and then in the central box add in the code below. For the first line type in Value = and then in the right hand column double click on the name you gave in 2 to add the "Format.NamedSubStrings("PackDate").Value" part.
  7. For the CamMonth Array line I have guessed at the other month abbreviations and so you will need to change these and also for the final line that determines how the data is displayed, I am guessing you will need to tweak this to match the output you require, such as - instead of / or perhaps in a different order etc, but hopefully this will point in you in the right direction. 

Here is the code I used and there are some screenshots below too which I hope help.

Pete

 

Value = Format.NamedSubStrings("PackDate").Value

Dim CanMonth
CanMonth = Array("0","JA","FE","MR","AP","MY","JN","JL","AU","SE","OC","NO","DC")

Value1 = Day(Value)

Value2 = Month(Value)

Value2 = CanMonth(Value2)

Value3 = Year(Value)

Value = Value1 & "/" & Value2 & "/" & Value3

 

 

0
Avatar
james nugent
Comment actions Permalink

Hi
I tried this but there was no " visual basic script source " or "edit with script editer "button I. Running the basic edition of bar tender. The version I am using is 2016 r3 basic. Would I need to update

0
Avatar
Pete Thane
Comment actions Permalink

Yes unfortunately, you would need to upgrade to the Professional edition

Please sign in to leave a comment.