I would like to ask how to change the name of the resulting data extract into the current date and time??? thanks master..
outputFileName = (configXML.outputfilename[0] || "yyyy-MMM-dd-HHmmss") + ".zip";
outputFileName = outputFileName.replace(/(\\|\/|:|\?|"|<|>|\|)/g, "");
it doesn't seem to replace dashes ... is that the issue or is getting the date time which you haven't show how you are getting?? In any event, once you have your date converted to a string use 'replace' to substitute the string elements replace("-","") yields 'YYYYMMMdd'
thanks you Patterson,,
i don't have date time string, can you help me for source data string date time for data extract arcgis flex?
sorry... I thought it would return that format of date, my comment was on the replace segment... it won't replace dashes if that is the format that is returned
Ahmad,
It would be something like this:
<mx:DateFormatter id="formatDate" formatString="YYYY-MMM-DD-LNNSS" />
outputFileName = (configXML.outputfilename[0] || formatDate.format(new Date)) + ".zip";
Thanks Robert, you very helpful
Hello Mr. Robert, Can u Help me.. Can add names format, if you choose shp format, will generate a name behind shp,,outputFileName = (configXML.outputfilename[0] || formatDate.format(new Date)) + "format choose"+ ".zip";
Ahmad,
outputFileName = (configXML.outputfilename[0] || formatDate.format(new Date)) + formatDDL.selectedItem.data.substring(0, formatDDL.selectedItem.data.indexOf("-") - 1) + ".zip";
Don't forget to mark this question as answered by clicking on the "Correct Answer" link on the reply that answered your question.
Sorry Mr. Robert,
i have not been able to find the solution of my problem to add the extension of the selected format.
from:
outputFileName = (configXML.outputfilename[0] || formatDate.format(new Date)) + formatDDL.selectedItem.data.substring(0, formatDDL.selectedItem.data.indexOf("-") - 1) + ".zip";
Ahmad,
When you tested what did it give you?
If you want just the file extension then try:
outputFileName = (configXML.outputfilename[0] || formatDate.format(new Date)) + formatDDL.selectedItem.data.substring(format.lastIndexOf(".") + 1, formatDDL.selectedItem.data.length) + ".zip";