Modifying auto-date format

Hello guys,
I'm using ID CS3 on a XP machine in Spanish.
I've been fiddling with this script to stamp today's date in an Indy document.
It works very good, and I got it to even insert tomorrow's date.
The resulting date is in this format: jueves, enero 12, 2012.
I am trying now to change it to this format (this is in Spanish): jueves, 12 de enero de 2012.
This is the script:
function dayMonthYear(date) {
// returns dayName, monthName date, year
// PLUS ONE DAY
date.setDate(date.getDate()+1);
var myDateString = date.toLocaleDateString();
myParts = myDateString.split(" 0");
if (myParts.length != 1) {
myDateString = myParts[0] + " " + myParts[1];
return myDateString.slice(0,-5) + " de" + myDateString.slice(-5);
Remember, ID and the OS are in Spanish, and according to date.toLocaleDateString() the script should return the date in this format: "jueves, 12 de enero de 2012". Why does it return "jueves, enero 12, 2012"?
I am not very good at scripting, but.. Can anybody help me change the script so it returns the date in my desired format?
Thanks a lot in advance.

What do you have to do? Well, it is tricky. It is tricky to get right. The better answer is "Don't."
But if you must, you'll have to be quite clear.
Exactly what do you want to do to the returend date string?
Specify it very clearly. Something like:
  Split it up into space-seperated words.
  Insert "de" between the 3rd and 4th word and the 7th and 8th word.
  Swap the 3rd and 5th words.
  Capitalize the first word.
  Put it all back together.
I can imagine many ways to poentially get what you want and as non-Spanish speaker, I am not sure what weird exceptions there are.
The split function divides a string on the specified character. Such as splitting a sentence into words by calling .split(" "), which splits on spaces.
See https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/String/Split for a good reference with some examples.

Similar Messages

  • How can I modify the date format in Autoimporter?

    I am finding it impossible to get my iMac recognise my Canon SX200 camera and thus allow Picasa to import its pics.  Autoimporter, though, does see it and will create and populate a usefully date-named folder with them.
    Useful up to a point - Autoimporter's date is in the system's format (for me, dd-mm-yyyy) which does not allow the folders to fall naturally into date order in Picasa.  International date format (yyyy-mm-dd) would be ideal.
    Can anyone advice how Autoimporter's date format can be modified, please?
    Or tell how they got their Canon SX200 to be recognised by Picasa?

    I actually use a pretty manual solution for this with a few command line tools: ExifTool, bash, and AppleScript. It's fairly raw, but here's the process in case you're intereted.
    First, make sure ExifTool is working. Install it if needed.
    Create a bash script that moves the photos from your auto-import folder to yyyy-mm-dd folders.
    Here's a sample bash script:
    #!/bin/bash
    SOURCE_DIR=“/Users/yourusername/Pictures/Imported"
    DEST_DIR=“/Users/yourusername/Pictures"
    if [ -d $DEST_DIR ]; then
         for i in $( find $SOURCE_DIR -type f ) ; do
              mkdir -p $(exiftool -d $DEST_DIR/%y%y-%m%m-%d%d/ -p '$DateTimeOriginal' $i);
              mv -n $i $DEST_DIR/$(stat -t %y%y-%m%m-%d%d $i | awk '{print $12}' | sed s/\"//g )/;
         done
    fi
    Create an AppleScript file that calls the bash script, example:
    do shell script "~/bin/movephotos.sh”
    Then right-click the folder where you auto-import files, go to Services > Folder Actions Setup, and connect the bash script as an action for the folder.
    For more details, see http://designsimply.com/2013/12/30/moving-iphone-photos-with-autoimporter-exifto ol-bash-applescript/

  • How to modify date format for Standard Purchase Order

    In the Standard Purchase Order I have been trying to modify the date format of the Need by and Promised Date. To display DD-MON-YYYY please could some advise.
    Thanks

    The varaibles and prarameters I am using are.
    <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:ora="http://www.oracle.com/XSL/Transform/java/" xmlns:xdofo="http://xmlns.oracle.com/oxp/fo/extensions" xmlns:xdoxslt="http://www.oracle.com/XSL/Transform/java/oracle.apps.xdo.template.rtf.XSLTFunctions" xmlns:xdoxliff="urn:oasis:names:tc:xliff:document:1.1">
    <xsl:param name="_XDOCALENDAR">GREGORIAN</xsl:param>
    <xsl:param name="_XDOLOCALE">en-US</xsl:param>
    <xsl:param name="_XDOTIMEZONE">GMT</xsl:param>
    <xsl:param name="_XDODFOVERRIDE">;</xsl:param>
    <xsl:param name="_XDOCTX">#</xsl:param>
    <xsl:variable name="_XDOXSLTCTX" select="xdoxslt:set_xslt_locale($_XDOCTX, $_XDOLOCALE, $_XDOTIMEZONE, $_XDOCALENDAR, $_XDODFOVERRIDE)" />

  • Date format in MVIEW

    Hi All,
    I have creted the snapshot as
    CREATE SNAPSHOT EMPLOYEE_CRIS_MVIEW
    PCTFREE 10
    PCTUSED 40
    MAXTRANS 255
    TABLESPACE users
    STORAGE (
    INITIAL 40960
    NEXT 73728
    PCTINCREASE 1
    MINEXTENTS 1
    MAXEXTENTS 505
    BUILD IMMEDIATE
    REFRESH ON DEMAND
    With rowid
    AS
    select
    emp_id,
    join_dt,
    emp_stat,
    from employee_CRIS
    The date format for the column join_dt is dd-mon-yyyy.
    But I want to modify the date format for this column as 'MM/DD/YYYY'.
    For that I tried
    ALTER snapshot EMPLOYEE_CRIS_MVIEW modify(TO_CHAR(join_dt,'MM/DD/YYYY'));
    But I got the error
    ERROR at line 1:
    ORA-00902: invalid datatype
    Could you please help me to change the change the date format of the column of the snapshot
    with out dropping the snapshot.
    Please help me.
    Thanks in advance.

    What people are saying is that date columns (of DATE datatype) are stored internally using a fixed internal notation, which is essentially a series of bytes that describe the date.
    e.g.
    SQL> select empno, ename, hiredate, dump(hiredate) as dump_hiredate from emp;
         EMPNO ENAME      HIREDATE            DUMP_HIREDATE
          7369 SMITH      17/12/1980 00:00:00 Typ=12 Len=7: 119,180,12,17,1,1,1
          7499 ALLEN      20/02/1981 00:00:00 Typ=12 Len=7: 119,181,2,20,1,1,1
          7521 WARD       22/02/1981 00:00:00 Typ=12 Len=7: 119,181,2,22,1,1,1
          7566 JONES      02/04/1981 00:00:00 Typ=12 Len=7: 119,181,4,2,1,1,1
          7654 MARTIN     28/09/1981 00:00:00 Typ=12 Len=7: 119,181,9,28,1,1,1
          7698 BLAKE      01/05/1981 00:00:00 Typ=12 Len=7: 119,181,5,1,1,1,1
          7782 CLARK      09/06/1981 00:00:00 Typ=12 Len=7: 119,181,6,9,1,1,1
          7788 SCOTT      19/04/1987 00:00:00 Typ=12 Len=7: 119,187,4,19,1,1,1
          7839 KING       17/11/1981 00:00:00 Typ=12 Len=7: 119,181,11,17,1,1,1
          7844 TURNER     08/09/1981 00:00:00 Typ=12 Len=7: 119,181,9,8,1,1,1
          7876 ADAMS      23/05/1987 00:00:00 Typ=12 Len=7: 119,187,5,23,1,1,1
          7900 JAMES      03/12/1981 00:00:00 Typ=12 Len=7: 119,181,12,3,1,1,1
          7902 FORD       03/12/1981 00:00:00 Typ=12 Len=7: 119,181,12,3,1,1,1
          7934 MILLER     23/01/1982 00:00:00 Typ=12 Len=7: 119,182,1,23,1,1,1
    14 rows selected.Here, you can see from the dumped dates that they are all stored as 7 bytes of data, which sort of resemble the date you see on the screen in some way, but not quite. It's an internal format that Oracle understands and uses, and it's important it's stored in this way so that date arithmetic and date range comparisons can be performed easily (and quickly) in queries.
    If we were to alter our sessions date format (the display format for our session only) and query the data again in the same way...
    SQL> alter session set nls_date_format='YYYY-MM-DD';
    Session altered.
    SQL> select empno, ename, hiredate, dump(hiredate) as dump_hiredate from emp;
         EMPNO ENAME      HIREDATE   DUMP_HIREDATE
          7369 SMITH      1980-12-17 Typ=12 Len=7: 119,180,12,17,1,1,1
          7499 ALLEN      1981-02-20 Typ=12 Len=7: 119,181,2,20,1,1,1
          7521 WARD       1981-02-22 Typ=12 Len=7: 119,181,2,22,1,1,1
          7566 JONES      1981-04-02 Typ=12 Len=7: 119,181,4,2,1,1,1
          7654 MARTIN     1981-09-28 Typ=12 Len=7: 119,181,9,28,1,1,1
          7698 BLAKE      1981-05-01 Typ=12 Len=7: 119,181,5,1,1,1,1
          7782 CLARK      1981-06-09 Typ=12 Len=7: 119,181,6,9,1,1,1
          7788 SCOTT      1987-04-19 Typ=12 Len=7: 119,187,4,19,1,1,1
          7839 KING       1981-11-17 Typ=12 Len=7: 119,181,11,17,1,1,1
          7844 TURNER     1981-09-08 Typ=12 Len=7: 119,181,9,8,1,1,1
          7876 ADAMS      1987-05-23 Typ=12 Len=7: 119,187,5,23,1,1,1
          7900 JAMES      1981-12-03 Typ=12 Len=7: 119,181,12,3,1,1,1
          7902 FORD       1981-12-03 Typ=12 Len=7: 119,181,12,3,1,1,1
          7934 MILLER     1982-01-23 Typ=12 Len=7: 119,182,1,23,1,1,1
    14 rows selected.... whilst the hiredate is now showing on the screen in the format we've chosen, the actual internal storage of those dates remains completely unchanged. i.e. we don't have to change the format of the internal storage of dates to make them display differently.
    Likewise you can format dates manually as part of your query using to_char function...
    SQL> select empno, ename, to_char(hiredate,'DD Month YYYY') as hiredate, dump(hiredate) as dump_hiredate from emp;
         EMPNO ENAME      HIREDATE          DUMP_HIREDATE
          7369 SMITH      17 December  1980 Typ=12 Len=7: 119,180,12,17,1,1,1
          7499 ALLEN      20 February  1981 Typ=12 Len=7: 119,181,2,20,1,1,1
          7521 WARD       22 February  1981 Typ=12 Len=7: 119,181,2,22,1,1,1
          7566 JONES      02 April     1981 Typ=12 Len=7: 119,181,4,2,1,1,1
          7654 MARTIN     28 September 1981 Typ=12 Len=7: 119,181,9,28,1,1,1
          7698 BLAKE      01 May       1981 Typ=12 Len=7: 119,181,5,1,1,1,1
          7782 CLARK      09 June      1981 Typ=12 Len=7: 119,181,6,9,1,1,1
          7788 SCOTT      19 April     1987 Typ=12 Len=7: 119,187,4,19,1,1,1
          7839 KING       17 November  1981 Typ=12 Len=7: 119,181,11,17,1,1,1
          7844 TURNER     08 September 1981 Typ=12 Len=7: 119,181,9,8,1,1,1
          7876 ADAMS      23 May       1987 Typ=12 Len=7: 119,187,5,23,1,1,1
          7900 JAMES      03 December  1981 Typ=12 Len=7: 119,181,12,3,1,1,1
          7902 FORD       03 December  1981 Typ=12 Len=7: 119,181,12,3,1,1,1
          7934 MILLER     23 January   1982 Typ=12 Len=7: 119,182,1,23,1,1,1
    14 rows selected.
    SQL>Again, the internal date format remains the same.
    It is important that, when you store date information you store it as DATE datatype and let oracle use it's internal format, so that it can accurately do the date arithmetic, date range searches and date ordering etc., that everyone likes to do in queries. If you try and store it as VARCHAR2 then not only can information be lost (i.e. is '01/02/2010' representing 1st February 2010 or is it 2nd January 2010?) but you prevent date arithmetic, range searches and ordering in your queries from working correctly (i.e. '03/01/2009' would work out to be a greater date than '01/02/2010'). To prove it...
    SQL> select 'Wrong' from dual where '03/01/2009' > '01/02/2010';
    'WRON
    Wrong
    SQL> ed
    Wrote file afiedt.buf
      1* select 'Wrong' from dual where to_date('03/01/2009','DD/MM/YYYY') > to_date('01/02/2010','DD/MM/YYYY')
    SQL> /
    no rows selected

  • Customer Aging Report VT Label Exclusion and Modification of Date Format

    Hi Folks!
    I need your thoughts on how to remove the 'VT' label in all amounts of the Customer Receivables Aging Report.... Since it is a system variable, and already have the VT label when it is called, any remedy on how to remove this?
    In line with this also,
    We would like to modify the date format of the Aging Dates at the Header of the Table of the Report. The system returns the date format YYYY-MM-DD. We would like to change it to DD-MM-YYYY. I used the Concat and date functions provided in the Formula in PLD... but it returns mismatch error.
    I have searched through the forum and find no answers with this. I know that this will help also other users with the same concerns.
    Thanks a lot.
    Fringe

    Skype was causing the problem :@

  • Date format in Email notifications

    Service Desk 7.01
    Windows 2008
    MS SQL DB
    When the notification emails are sent out to the user, the date format is in US format (mm/dd/yyyy) and we would like it to be Aus format (dd/mm/yyyy).
    I have set the Default Date Style under Setup > Customer and in Setup > Email > Templates Date Style at the bottom of the window, but it is still showing as the US format.
    Is there another place that it needs to be changed?

    Originally Posted by Madgwicks
    Service Desk 7.01
    Windows 2008
    MS SQL DB
    When the notification emails are sent out to the user, the date format is in US format (mm/dd/yyyy) and we would like it to be Aus format (dd/mm/yyyy).
    I have set the Default Date Style under Setup > Customer and in Setup > Email > Templates Date Style at the bottom of the window, but it is still showing as the US format.
    Is there another place that it needs to be changed?
    It is working in my setup. I modified the date format in setup>Email >Templates and selected Email Summary Templates and modified the format in Date Style. Attach more screen shots.

  • How to modify date format for Standard Purchase Order  Template XSL-FO

    I am editing the XSL-FO for the Standard Purchase Order.
    I need to modify the promised date column to 'DD-MON-YYYY’' , tried to use substring in below line but it didn't work
    <xsl:value-of select="LINE_LOCATIONS/LINE_LOCATIONS_ROW/PROMISED_DATE"/>
    Any solution for this ?
    thanks
    Pravin

    Thanks for your response.
    I tried to change the code in below format but it was giving error.
    Original code
    <xsl:value-of select="LINE_LOCATIONS/LINE_LOCATIONS_ROW/PROMISED_DATE"/>
    modified to
    <xsl:value-of select="xdoxslt:format_date(LINE_LOCATIONS/LINE_LOCATIONS_ROW/PROMISED_DATE,'dd-mmm-yyyy','dd/mmm/yyyy hh24:mi:ss',$_XDOLOCALE,$_XDOTIMEZONE)"/>
    also tried with
    <xsl:value-of select="xdoxslt:format_date(LINE_LOCATIONS/LINE_LOCATIONS_ROW/PROMISED_DATE,'dd-mmm-yyyy','dd-mmm-yyyy hh24:mi:ss',$_XDOLOCALE,$_XDOTIMEZONE)"/>
    also tried like
    <xsl:value-of select="xdoxslt:format_date(LINE_LOCATIONS/LINE_LOCATIONS_ROW/PROMISED_DATE,'dd-mmm-yyyy','dd/mmm/yyyy',$_XDOLOCALE,$_XDOTIMEZONE)"/>
    Tried above 3 methods but it didn't work.
    right now the date format in pdf file is 24-MAY-2011 21:56:24 i need to remove 21:56:24 and have only 24-MAY-2011
    any suggestions.
    thanks

  • I have a acrobat reader, can I import text delimited data format to a PDF Form so that it can auto fill into forms that was created? If not, what about FDF and XML data

    I have a acrobat reader, can I import text delimited data format to a PDF Form so that it can auto fill into forms that was created? If not, what about FDF and XML data

    Yes, you can do all of that via Tools - Forms - More Form Options - Import Data, if you have Acrobat.
    If you only have the free Reader then you can still do it, but it requires a script.

  • How to modify Bridge CS6 default sub-folder date format while importing?

    How could I modify Bridge CS6 default sub-folder date format when we are importing images from a connected camera? Default format for shooting date is aaaammjj. I would like instead aaaa_mm_jj. How could I add "_" to the date format?

    You only can do so after the import process using a third party app called A better finder Rename,  originally designed for Mac but they seem to have a Windows version also:
    http://www.publicspace.net/ABetterFinderRename/

  • Where to modify code to format data

    I am using BC4J and am pulling a date from the database. I want to just display the date in a custom format. Where do I do this at? This date will also be inputed by the user to insert into the database.
    I am using Data Tags, but would prefer to use something more like UseBean tags.
    TIA

    I would like to do the same a Gerald. Has anyone created a custom tag that returns custom date format from BC4J. I actually am only viewing the date not actually inserting it back to the DB.
    I know that this will be available in the next release but that is still a while away.
    The code I am using is as follows:
    <jbo:ShowValue datasource="TableName" dataitem="LastUpdTs" ></jbo:ShowValue>
    null

  • Can I modify the data type of a dynamic parameter?

    I am using CR2008 against an Oracle 11 db and have a report with dynamic parameters.
    One of the report sources is a custom view that selects all of the possible 'pay ending dates' where one of the fields from this view is used as the source for the dynamic parameter.
    The view performs a TRUNC on the date field in an effort to eliminate the TIME component.
    The problem is that the parameter definintion defaults to DATE/TIME (vs. just DATE). I'm wondering if there is any way to modify the data type of the parameter to be DATE only.
    I've searched several forumns but have not found anything.
    One solution I can think of is to have the custom view format the date field as a VARCHAR (sans the time component) which I assume would force the dynamic parameter data type to string, and then have the report perform a todate function on the value when applying the criteria.
    Anyone else have an idea? Just seems like CR should allow the developer to specify the data type- especially b/w Date and Date/Time, rather than make an assumption.
    Thank you in advance-
    emaher

    emaher,
    Here's what you can do:
    Leave the existing date column as it is in the view...
    Just add another column to the view that casts the the date as a VarChar data type and formats the date as you would like it to be.
    So now you'll have 2 date columns in the view... 1 that's still a date and another that a character string.
    Now for your parameter, use the date version as the parameter value and the text version as the parameter description.
    Be sure to set the "Prompt with description only" is set to true.
    This way the user sees the LoV in the desired format but there's not need to wrangle it back into a date for data selection.
    HTH,
    Jason

  • Cell data format problem

    Hello,
    I just began using the new version of Numbers.
    I tried to make a distance-speed-time function and have it as hour, minute and second but when I switch from automatic data format to custom data format (Duration) and go to the next cell to do the same, it switch back to automatic data format and I can't have it as time but just a a number with decimals.
    What can I do ?

    I have a similar issue.
    Every number I enter is understood by Numbers as a date.
    199 becomes the date 1/1/199 00.00.00 when I try and change the auto format it jumps right back to the date.
    I have to format the cell to be a number before I enter a value.
    is your system language english or non english? I have a suspicion it's a locale bug (one that Apple QA should have found had they done any testing...)

  • In IOS 6 my date format was YYYY-MM-DD. When I switched to IOS 7, it changed to MM-DD-YYYY. How do you change it?

    In IOS 6 my date format was YYYY-MM-DD, which is ISO 8601 standard used in Canada.  When I switched to IOS 7, it changed to MM-DD-YYYY format which is very confusing as all my cameras etc use YYYY-MM-DD.  How do you change it, like one can in OSX?

    It appears previous versions of IOS would pick up your preferred date format from your OSX Mac. You can modify that to whatever you like.
    Now if you select Canadian or American in IOS 7 you get only MM-DD-YYYY.  This is wrong for Canada as the preferred date format here is YYYY-MM-DD, just check your birth or expiry dates on your Ontario Drivers License or OHIP Health Card.  Or the date field at the bottom left of any Government of Canada website.
    The trouble with using other Country codes is you tend to get their currency codes like € or £ and the terms like yesterday and today in their language.

  • How to change the date format from default to mm-dd-yyyy?

    Hi,
    There is a requirement to show the current date in an error message at the attribute level. That is, if the user input a date in a text field that is earlier than today's date, then an error message must immediately pop up with today's date in the message. To achieve this we are using a token expression in the EO ( Under Validation rules) . The token expression uses adf.currentDate to get today's date.
    The problem is that the expression extracts the date in the form of yyyy-mm-dd. What expression should I use to get the current date format in mm/dd/yyyy ? Can I modify the adf.currentDate expression in some way to get the desired format?
    Thanks,
    Anand

    You could write a custom EO method to return today's date in the specific format. Then access it via the Groovy adf.object expression.

  • How to update the default date format in OBIEE 11G.

    Hi All,
    How to change the default date format in OBIEE 11g from the MM/DD to DD/MM. Could anyone please help me out ASAP?
    Thanks,
    Arpan

    Hi Arpan
    OBIEE 11g is having " localedefinitions.xml " file at this Location C:\Oracle\Middleware\Oracle_BI1\bifoundation\web\display
    in my case i installed at C:\Oracle\MIddleware.
    so
    1- Stop BI Server from EM
    2- Navigate to this Location C:\Oracle\Middleware\Oracle_BI1\bifoundation\web\display. in your case oracle home will be different
    3- take a backup of this file localedefinitions.xml "
    4- modify it and save
    5- bring BI Server up.
    Regards
    sher

Maybe you are looking for

  • I can no longer open most videos sent to me.

    Hi, I can no longer open most videos sent to me on Facebook - my warranty is expired even though my MacBook Air is just a little over a year old - any suggestions would be appreciated.  TIA

  • ITunes 10.5 AirPlay does not stream from my pc to airport express or apple tv

    Windows 7/32 bit, Time Capsule router (one WiFi system in home), Airport Express for music and all listed in Router DHCP assignments. All with the latest software. Before iTunes and iOS5 upgrade worked OK. Now no PC iTunes Airplay icon even though th

  • HELP! Emails in Mail are suddenly gone. How do I change this?

    Hello -- Using Leopard 10.5.5 and Mail 3.5. Can I change it so that Mail does not automatically delete emails? In the Mail app on my iBook, the emails never go away (unless I delete them..) Yet on my G5 and my MacPro the emails get deleted after awhi

  • My wifes gonna be upset, did I fry the MacBook?

    Attempted to give wife my iPhone, upon connection to her MB iTunes informed that she needed 7.7. I ran updater and it attempted to install Safari, iTunes and a security update... That's when the beachball of death appeared, during the security update

  • RE: Strange Error.

    Tres, Make sure that the following file exist: /adedev1/userapp/daucbri/cl0/DAUBRI.a It might have compiled fine but might have not moved it to the userapp directory. This happens when you load the distribution from econsole. Another thing I noticed